Rev | Line | |
---|
[176] | 1 | #ifndef _SASSERT_H_ |
---|
| 2 | #define _SASSERT_H_ |
---|
| 3 | |
---|
| 4 | /** |
---|
| 5 | * @class sassert |
---|
| 6 | * @brief Implements compile-time assertion checking. |
---|
| 7 | * @author Emery Berger <http://www.cs.umass.edu/~emery> |
---|
| 8 | * |
---|
| 9 | * @code |
---|
| 10 | * sassert<(1+1 == 2)> CheckOnePlusOneIsTwo; |
---|
| 11 | * @endcode |
---|
| 12 | * |
---|
| 13 | * This code is part of the Hoard distribution and is governed by its license. |
---|
| 14 | * <http://www.hoard.org> |
---|
| 15 | * |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | namespace HL { |
---|
| 19 | |
---|
| 20 | template <int assertion> |
---|
| 21 | class sassert; |
---|
| 22 | |
---|
| 23 | template<> class sassert<1> { |
---|
| 24 | public: |
---|
| 25 | enum { VALUE = 1 }; |
---|
| 26 | }; |
---|
| 27 | |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.