Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/sound6/src/external/loki/static_check.h @ 8662

Last change on this file since 8662 was 7266, checked in by rgrieder, 14 years ago

Moved Loki library files to separate loki folder in externals.
Also added TypeManip.h (now used in Convert.h) and static_check.h.

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1////////////////////////////////////////////////////////////////////////////////
2// The Loki Library
3// Copyright (c) 2001 by Andrei Alexandrescu
4// This code accompanies the book:
5// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
6//     Patterns Applied". Copyright (c) 2001. Addison-Wesley.
7// Permission to use, copy, modify, distribute and sell this software for any
8//     purpose is hereby granted without fee, provided that the above copyright
9//     notice appear in all copies and that both that copyright notice and this
10//     permission notice appear in supporting documentation.
11// The author or Addison-Wesley Longman make no representations about the
12//     suitability of this software for any purpose. It is provided "as is"
13//     without express or implied warranty.
14////////////////////////////////////////////////////////////////////////////////
15#ifndef LOKI_STATIC_CHECK_INC_
16#define LOKI_STATIC_CHECK_INC_
17
18// $Id: static_check.h 982 2009-01-31 07:51:27Z rich_sposato $
19
20
21namespace Loki
22{
23////////////////////////////////////////////////////////////////////////////////
24// Helper structure for the STATIC_CHECK macro
25////////////////////////////////////////////////////////////////////////////////
26
27    template<int> struct CompileTimeError;
28    template<> struct CompileTimeError<true> {};
29}
30
31////////////////////////////////////////////////////////////////////////////////
32// macro LOKI_STATIC_CHECK
33// Invocation: LOKI_STATIC_CHECK(expr, id)
34// where:
35// expr is a compile-time integral or pointer expression
36// id is a C++ identifier that does not need to be defined
37// If expr is zero, id will appear in a compile-time error message.
38////////////////////////////////////////////////////////////////////////////////
39
40#define LOKI_STATIC_CHECK(expr, msg) \
41    { Loki::CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; }
42
43
44#endif // end file guardian
45
Note: See TracBrowser for help on using the repository browser.