Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_CompileTimeAssert.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_COMPILE_TIME_ASSERT_HPP
11 #define TEUCHOS_COMPILE_TIME_ASSERT_HPP
12 
17 #include "Teuchos_ConfigDefs.hpp"
18 
19 namespace Teuchos {
20 
24 
27 template <int Test>
29  int compile_time_assert_failed[Test-1000]; // Should not compile if instantiated!
30 };
31 
33 template <>
34 class CompileTimeAssert<0> {};
35 
37 
38 } // namespace Teuchos
39 
40 #endif // TEUCHOS_COMPILE_TIME_ASSERT_HPP
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
If instantiated (for Test!=0) then this should not compile!