Rani Sharoni's port
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@33 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
b233e001b3
commit
301d96c6a1
26 changed files with 7909 additions and 694 deletions
|
@ -24,8 +24,14 @@ namespace Loki
|
|||
// Helper structure for the STATIC_CHECK macro
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<int> struct CompileTimeError;
|
||||
template<> struct CompileTimeError<true> {};
|
||||
template<bool CompileTimeAssertion>
|
||||
struct CompileTimeError;
|
||||
|
||||
template<>
|
||||
struct CompileTimeError<true>
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -38,14 +44,14 @@ namespace Loki
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define STATIC_CHECK(expr, msg) \
|
||||
{ Loki::CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; }
|
||||
|
||||
typedef char ERROR_##msg[1][(expr)]
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Change log:
|
||||
// March 20, 2001: add extra parens to STATIC_CHECK - it looked like a fun
|
||||
// definition
|
||||
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
|
||||
// July 09, 2002: improved for favor of VC diagnostic and usage
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // STATIC_CHECK_INC_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue