Advertisement
tinyevil

Untitled

Jan 12th, 2019
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. template<class A, class B>
  2. class Pair{
  3.     A fst;
  4.     B snd;
  5. }
  6.  
  7. template<class A, class B>
  8. A get_fst(Pair<A,B> p){
  9.     return p.fst;
  10. }
  11.  
  12.  
  13. void main(){
  14.     Pair<()->i32, i32> p{() => 42, 17};
  15.     auto x = get_fst(p);
  16.     // does this compile?
  17.     // whats the type of x?
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement