source: proiecte/swift/trunk/lib/hoard-371/src/check.h @ 176

Last change on this file since 176 was 176, checked in by (none), 14 years ago
  • imported repo from "guagal"
File size: 464 bytes
Line 
1// -*- C++ -*-
2
3#ifndef _CHECK_H_
4#define _CHECK_H_
5
6template <class TYPE, class CHECK>
7class Check {
8public:
9  Check (TYPE * t)
10#ifndef NDEBUG
11    : _object (t)
12#endif
13  {
14    t = t; // avoid warning
15#ifndef NDEBUG
16    CHECK::precondition (_object);
17#endif
18  }
19
20  ~Check (void) {
21#ifndef NDEBUG
22    CHECK::postcondition (_object);
23#endif
24  }
25
26private:
27  Check (const Check&);
28  Check& operator=(const Check&);
29
30#ifndef NDEBUG
31  TYPE * _object;
32#endif
33
34};
35
36#endif
Note: See TracBrowser for help on using the repository browser.