Viskores  1.0
StaticAssert.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_StaticAssert_h
19 #define viskores_StaticAssert_h
20 
21 
22 #include <type_traits>
23 
24 #define VISKORES_STATIC_ASSERT(condition) \
25  static_assert((condition), "Failed static assert: " #condition)
26 #define VISKORES_STATIC_ASSERT_MSG(condition, message) static_assert((condition), message)
27 
28 namespace viskores
29 {
30 
31 template <bool noError>
33 
34 template <>
35 struct ReadTheSourceCodeHereForHelpOnThisError<true> : std::true_type
36 {
37 };
38 
39 } // namespace viskores
40 
41 #define VISKORES_READ_THE_SOURCE_CODE_FOR_HELP(noError) \
42  VISKORES_STATIC_ASSERT(viskores::ReadTheSourceCodeHereForHelpOnThisError<noError>::value)
43 
44 #endif //viskores_StaticAssert_h
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::ReadTheSourceCodeHereForHelpOnThisError
Definition: StaticAssert.h:32