#ifndef KUODO_TYPES_ASSERT_HPP #define KUODO_TYPES_ASSERT_HPP namespace kuodo { namespace types { /// /// has enum member assert only if if_ is true /// - used by types::assert /// - useful for types::type_assert template struct assertion { enum { assert }; }; template<> struct assertion {}; // assert ///////////////////////////////////////////////////////////////////// /// compiler error if if_ is false. /// \code /// /// typedef types::assert myassert; /// /// // compiler error like: /// // file.hpp:123: error: 'assert' is not a member of 'kuodo::types::assertion' /// /// \endcode /// /// see /// - types::assertion /// - types::type_assert template::assert> struct assert {}; // type_assert ///////////////////////////////////////////////////////////////////// /// compiler error if if_ does not have compile-time int member assert. /// \code /// /// template struct /// void_is_wrong /// { enum { assert }; }; /// template<> struct /// void_is_wrong /// {}; /// /// typedef types::type_assert > myassert; /// /// // compiler error like: /// // file.hpp:123: error: 'assert' is not a member of 'void_is_wrong' /// /// \endcode /// /// see /// - types::assertion (useful as base-class to if_) /// - types::assert template struct type_assert {}; } } //namespace kuodo::types #endif //KUODO_TYPES_ASSERT_HPP