[ create a new paste ] login | about

Link: http://codepad.org/qwrqJtVS    [ raw code | output | fork ]

C++, pasted on Aug 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <cstdio>
#include <typeinfo>
#include <type_traits>
template<class U, class V> void f2(V x)
{
        printf("%s\n", typeid(U).name());
}
template<class T> void f(T x)
{
        f2<typename std::remove_pointer<T>::type>(x);
}
int main(void)
{
        f(reinterpret_cast<char *>(NULL));
        f(reinterpret_cast<const char *>(NULL));
        f(reinterpret_cast<int *>(NULL));
        f(reinterpret_cast<const int *>(NULL));
        return 0;
}


Output:
1
2
3
4
Line 22: error: type_traits: No such file or directory
In function 'void f(T)':
Line 10: error: 'remove_pointer' in namespace 'std' does not name a type
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: