MPLLIBS_TYPECLASS_EXPECT

Synopsis

#define MPLLIBS_TYPECLASS_EXPECT(name) \
  // unspecified

Description

Macro for defining a typedef for throwing a compile-time exception. The purpose of the macro is improving readability of typeclass expectation descriptions. The expection thrown is invalid_typeclass.

#include <mpllibs/metamonad/typeclass.hpp>

Expression semantics

The following

MPLLIBS_TYPECLASS_EXPECT(some_fun);

is equivalent to

typedef mpllibs::metamonad::exception<invalid_typeclass> some_fun;

Example

template <class Tag>
struct example_typeclass
{
  MPLLIBS_TYPECLASS_EXPECT(some_fun);
  MPLLIBS_TYPECLASS_EXPECT(some_other_fun);
};

[up]