cml_assert.h File Reference

Macros and template metaprogramming to implement compile- and run-time assertions. More...

#include <cml/core/cml_meta.h>

Include dependency graph for cml_assert.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cml::STATIC_ASSERTION_FAILURE< true >
 Struct instantiated when a true assertion is made at compile-time. More...
struct  cml::STATIC_ASSERTION_FAILURE_M< T, M >
 A more meaningful compile-time assertion struct. More...
struct  cml::STATIC_ASSERTION_FAILURE_M< true, M >
 Instantiated for true assertions. More...

Namespaces

namespace  cml

Defines

#define CML_DO_JOIN(X, Y)   CML_DO_JOIN2(X,Y)
#define CML_DO_JOIN2(X, Y)   X##Y
#define CML_JOIN(X, Y)   CML_DO_JOIN(X,Y)
#define CML_STATIC_REQUIRE(_E_)
 Create a compile-time assertion.
#define CML_STATIC_REQUIRE_M(_E_, _M_)
 Create a compile-time assertion with a message.
#define TO_STRING(X)   TO_STRING2(X)
#define TO_STRING2(X)   #X


Detailed Description

Macros and template metaprogramming to implement compile- and run-time assertions.

Definition in file cml_assert.h.


Define Documentation

#define CML_DO_JOIN ( X,
 )     CML_DO_JOIN2(X,Y)

Definition at line 25 of file cml_assert.h.

#define CML_DO_JOIN2 ( X,
 )     X##Y

Definition at line 26 of file cml_assert.h.

#define CML_JOIN ( X,
 )     CML_DO_JOIN(X,Y)

Definition at line 24 of file cml_assert.h.

#define CML_STATIC_REQUIRE ( _E_   ) 

Value:

typedef typename STATIC_ASSERTION_FAILURE<(_E_)>::result \
        CML_JOIN(__cml_assert_test_typedef_, __LINE__)
Create a compile-time assertion.

Note:
Compile-time assertions must be expressions that can be evaluated at comile time. This means that the expression must only rely on constants, enums, and/or template parameters, not variables having run-time storage requirements.
Warning:
Enclose expressions that have commas with parens, otherwise the preprocessor will parse the commas as macro argument separators!
See also:
STATIC_ASSERTION_FAILURE

Definition at line 53 of file cml_assert.h.

#define CML_STATIC_REQUIRE_M ( _E_,
_M_   ) 

Value:

typedef typename STATIC_ASSERTION_FAILURE_M<(_E_),_M_> \
        ::result CML_JOIN(__bogus_assert_type_, __LINE__)
Create a compile-time assertion with a message.

Note:
Compile-time assertions must be expressions that can be evaluated at comile time. This means that the expression must only rely on constants, enums, and/or template parameters, not variables having run-time storage requirements.
Warning:
Enclose expressions that have commas with parens, otherwise the preprocessor will parse the commas as macro argument separators!
See also:
STATIC_ASSERTION_FAILURE_M

Definition at line 88 of file cml_assert.h.

Referenced by cml::et::CheckedSquare(), cml::detail::CheckMat(), cml::detail::CheckMatMinNxM(), cml::detail::CheckMatNxM(), cml::detail::CheckMatSquare(), cml::detail::CheckQuat(), cml::detail::CheckVec(), cml::detail::CheckVec2Or3(), cml::detail::CheckVecN(), cml::cross(), cml::dot(), cml::detail::lu_copy(), cml::detail::lu_inplace(), cml::detail::MatMulCheckedSize(), cml::detail::matrix_total_order(), cml::detail::matrix_weak_order(), cml::detail::mul(), cml::outer(), cml::perp_dot(), cml::detail::quaternion_total_order(), cml::detail::quaternion_weak_order(), cml::detail::Require2D(), cml::detail::Require3D(), cml::detail::vector_total_order(), and cml::detail::vector_weak_order().

#define TO_STRING (  )     TO_STRING2(X)

Definition at line 29 of file cml_assert.h.

#define TO_STRING2 (  )     #X

Definition at line 30 of file cml_assert.h.


Generated on Sat Jul 18 19:35:36 2009 for CML 1.0 by  doxygen 1.5.9