Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-27 08:50:10

0001 //  Copyright Matt Borland 2021 - 2023.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_NUMERIC_ODEINT_TOOLS_TRAITS
0007 #define BOOST_NUMERIC_ODEINT_TOOLS_TRAITS
0008 
0009 #include <type_traits>
0010 
0011 namespace boost {
0012 namespace numeric {
0013 namespace odeint {
0014 namespace detail {
0015 
0016 #define BOOST_NUMERIC_ODEINT_HAS_NAMED_TRAIT(trait, name)               \
0017 template <typename T>                                                   \
0018 class trait                                                             \
0019 {                                                                       \
0020 private:                                                                \
0021    using yes = char;                                                    \
0022    struct no { char x[2]; };                                            \
0023                                                                         \
0024    template <typename U>                                                \
0025    static yes test(typename U::name* = nullptr);                        \
0026                                                                         \
0027    template <typename U>                                                \
0028    static no test(...);                                                 \
0029                                                                         \
0030 public:                                                                 \
0031    static constexpr bool value = (sizeof(test<T>(0)) == sizeof(char));  \
0032 };
0033 
0034 } //namespace detail
0035 } //namespace odeint
0036 } //namespace numeric
0037 } //namespace boost
0038 
0039 #endif //BOOST_NUMERIC_ODEINT_TOOLS_TRAITS