1 #ifndef BOOST_NUMERIC_CONCEPT_NUMERIC_HPP 2 #define BOOST_NUMERIC_CONCEPT_NUMERIC_HPP 3 4 // Copyright (c) 2012 Robert Ramey 5 // 6 // Distributed under the Boost Software License, Version 1.0. (See 7 // accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt) 9 10 #include <limits> 11 12 namespace boost { 13 namespace safe_numerics { 14 15 template<class T> 16 struct Numeric { 17 // if your program traps here, you need to create a 18 // std::numeric_limits class for your type T. see 19 // see C++ standard 18.3.2.2 20 static_assert( 21 std::numeric_limits<T>::is_specialized, 22 "std::numeric_limits<T> has not been specialized for this type" 23 ); 24 }; 25 26 } // safe_numerics 27 } // boost 28 29 #endif // BOOST_NUMERIC_CONCEPT_NUMERIC_HPP 30