iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::NotATypeError Struct Reference

#include <nrt/Core/Typing/ErrorType.H>

A type to indicate an error in metaprogramming.

Useful in metaprogramming to give errors where a static_assert isn't appropriate. For example, we need a class that indicates whether a type is an EvenCoolerClass or not, and typedef it if it is. What should we do if it isn't though? We want to let people know that they are accessing something that could be, but isn't defined.

template <class T>
class MyCoolClass
{
static const bool is_even_cooler = 0;
typedef NotATypeError MyCoolType;
}
// T is EvenCoolerClass
template <>
class MyCoolClass<EvenCoolerClass>
{
static const bool is_even_cooler = 1;
typedef EvenCoolerClass MyCoolType;
}
Examples:
tests/test-ImagePerformance.C, and tests/test-Traits.C.

Definition at line 67 of file ErrorType.H.


The documentation for this struct was generated from the following file: