#include <iostream> template <std::size_t N> struct Debug; // No definition struct obj{ int oldField; int newField; }; template <> struct Debug<4> {}; // Definition for "old" sizeof; template struct Debug<sizeof(obj)>; // instanciate Debug, issue error if definition is missing int main() {}
Standard input is empty
prog.cpp:14:17: error: explicit instantiation of ‘struct Debug<8ul>’ before definition of template template struct Debug<sizeof(obj)>; // instanciate Debug, issue error if definition is missing ^~~~~~~~~~~~~~~~~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!