SHARE
TWEET

n2liquid

a guest Sep 28th, 2009 93 Never
  1. int someFunction()
  2. {
  3.     typedef std::vector<std::list<float>::iterator> T;
  4.  
  5.     std::cout << getTypeName<T>() << '\n'; // prints `someFunction()::T'
  6.  
  7.     // Weirdly enough, for function pointer typedefs, that doesn't happen:
  8.     typedef void (*U)(std::vector<std::list<float>::iterator>);
  9.  
  10.     std::cout << getTypeName<U>() << '\n'; // prints
  11.             // `void (*)(std::vector<std::_List_iterator<float>,
  12.             // std::allocator<std::_List_iterator<float> > >)'
  13. }
RAW Paste Data
Top