template <typename T>struct type_name_is {}; template <typename T>void type_name_error(const T&){ // will error with type name: type_name_is<T>::showing_type_name();} int main(){ type_name_error(42u + -43);}
Standard input is empty
prog.cpp: In function ‘void type_name_error(const T&) [with T = unsigned int]’: prog.cpp:13: instantiated from here prog.cpp:8: error: ‘showing_type_name’ is not a member of ‘type_name_is<unsigned int>’
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!