Guest User

g++ compile error

a guest
Oct 18th, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. template<class F1, class F2>
  2. F2 operator|(F1 f1, F2 f2) { return [=](unsigned long long x) { return f2(f1(x)); }; };
  3.  
  4. auto func1 = [](unsigned long long x) { return 2.F*x; };
  5.  
  6. auto func2 = [](float x) { return (int)x; };
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10.   auto comp = func1|func2;
  11. }
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment