1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <string>
#include <type_traits>
template< typename T >
void verify_pod()
{
static_assert( std::is_pod<T>::value, "T is not a POD" );
}
int main()
{
verify_pod< std::string >();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
g++-4.8 -std=c++11 -O2 -Wall -pedantic -pthread main.cpp && ./a.out
main.cpp: In instantiation of 'void verify_pod() [with T = std::basic_string<char>]':
main.cpp:12:31:   required from here
main.cpp:7:5: error: static assertion failed: T is not a POD
     static_assert( std::is_pod<T>::value, "T is not a POD" );
     ^