#include <type_traits> template <typename T>class X { static_assert(!std::is_same<T, double>(), "Nie lubimy double");}; int main() { X<double> x; // <- nie dziala // X<int> x; // <- dziala}
Standard input is empty
prog.cpp: In instantiation of 'class X<double>': prog.cpp:9:12: required from here prog.cpp:5:3: error: static assertion failed: Nie lubimy double static_assert(!std::is_same<T, double>(), "Nie lubimy double"); ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!