Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 7th, 2012  |  syntax: C++  |  size: 0.24 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. static void fFunc()
  5. {
  6.     static T var;
  7.     (void)var;
  8.     struct g {
  9.         static void gFunc()
  10.         { std::cin >> var; };
  11.     };
  12.     g::gFunc();
  13. }
  14.  
  15. int main()
  16. {
  17.     fFunc<int>();
  18. }