Template Struct decorate_const

Struct Documentation

template<typename T>
struct decorate_const

If needed, add the ‘const’ qualifier to the provided type.

Avoids adding the const qualifier twice (aka ‘const const int’)

assert(typeid(decorate_const<int>::type)==typeid(const int));
assert(typeid(decorate_const<const int>::type)==typeid(const int));

Public Types

typedef const T type