fail_with_type

Synopsis

template <class T>
void fail_with_type();

Description

Template function for enforcing the compiler to display a type. Calling this template function emits a compilation error and the error message contains the T type. It is useful for debugging template metaprograms.

#include <mpllibs/metamonad/fail_with_type.hpp>

Expression semantics

For any t type the following

fail_with_type<t>();

emits a compilation error and the error message contains the type t.

Example

MPLLIBS_METAFUNCTION(some_metafunction, (t))
((
  // do something here...
));

int main()
{
  using mpllibs::metamonad::box;

  fail_with_type< some_metafunction<box<int>>::type >();
}

[up]