fork download
  1. template< class T > struct remove_pointer {typedef T type;};
  2. template< class T > struct remove_pointer<T*> {typedef T type;};
  3.  
  4. template<class ptr_to_t>
  5. void f(ptr_to_t x) {
  6. typedef ptr_to_t t; // does not compile
  7. typename remove_pointer<t>::type elem = *x;
  8. }
  9.  
  10. int main()
  11. {
  12. int five = 5;
  13. f<int*>(&five);
  14. return 0;
  15. }
Success #stdin #stdout 0s 2724KB
stdin
Standard input is empty
stdout
Standard output is empty