As Timo Grush said: the directive #pragma message used for this.
As an exotic side effect of template metaprogramming, it can also use the compiler as a calculator :)
template<int i> struct Message; template<int i> struct Fac { static const int v = i * Fac< i-1 >::v; }; template<> struct Fac<1> { static const int v = 1; }; Message< Fac<10>::v > m;
will result in an output message
Line 10: error: aggregate 'Message<3628800> m' has incomplete type and cannot be defined
xtofl source share