~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to ext/loki/loki-0.1.6/include/loki/static_check.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-04-07 13:16:05 UTC
  • mfrom: (1.2.7 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090407131605-u422yigfv7jgg0l0
Tags: 2.0.0-3
* Cleaned up packaging a little bit.
* Added homepage information to control file.
* Bumped Standards-Version to 3.8.1.
* Released to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 752 2006-10-17 19:52:18Z syntheticpp $
19
 
 
20
 
 
21
 
namespace 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 STATIC_CHECK
33
 
// Invocation: 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