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