1 // Copyright Leandro Lucarella 2008 - 2010.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file COPYING or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef POSIXX_STATIC_ASSERT_HPP_
8 #define POSIXX_STATIC_ASSERT_HPP_
10 template <bool x> struct POSIXX_STATIC_ASSERTION_FAILURE;
11 template <> struct POSIXX_STATIC_ASSERTION_FAILURE<true> { enum {value = 1}; };
12 #define static_assert( B, M ) \
13 enum { static_assert_enum_ ## __LINE__ \
14 = sizeof(POSIXX_STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
16 #endif // POSIXX_STATIC_ASSERT_HPP_