lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master a1763f3 2/2: Replace boost with std type_trai


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a1763f3 2/2: Replace boost with std type_traits
Date: Mon, 9 Jan 2017 13:01:18 +0000 (UTC)

branch: master
commit a1763f309649f05f2cd343edfa3dcdbe8622f9a4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Replace boost with std type_traits
---
 alert.cpp                  |    4 ++--
 any_member.hpp             |    9 ++++-----
 callback.hpp               |   10 ++++------
 ieee754.hpp                |    8 ++++----
 input_seq_helpers.hpp      |    4 ++--
 math_functors.hpp          |   20 ++++++++++----------
 math_functors_test.cpp     |   11 ++++++-----
 mc_enum.hpp                |    4 ++--
 multidimgrid_safe.hpp      |    8 ++++----
 mvc_controller.tpp         |   11 +++++------
 numeric_io_cast.hpp        |   15 +++++++--------
 numeric_io_traits.hpp      |   10 +++++-----
 pchlist.hpp                |    2 +-
 round_to.hpp               |    4 ++--
 safely_dereference_as.hpp  |    7 +++----
 stream_cast.hpp            |    9 ++++-----
 tn_range.hpp               |    4 ++--
 tn_range.tpp               |   18 +++++++++---------
 tn_range_type_trammels.hpp |    4 ++--
 uncopyable_lmi.hpp         |    5 +++--
 view_ex.tpp                |    4 ++--
 wx_utility.hpp             |   14 ++++++--------
 xml_serializable.tpp       |   11 +++++------
 xml_serialize.hpp          |    4 ++--
 24 files changed, 96 insertions(+), 104 deletions(-)

diff --git a/alert.cpp b/alert.cpp
index fc6cc3f..11b7753 100644
--- a/alert.cpp
+++ b/alert.cpp
@@ -24,7 +24,6 @@
 #include "alert.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
 
 #if !defined LMI_MSW
 #   include <cstdio>
@@ -35,6 +34,7 @@
 #include <ios>
 #include <sstream>                      // std::stringbuf
 #include <stdexcept>
+#include <type_traits>
 
 namespace
 {
@@ -196,7 +196,7 @@ template<typename T>
 inline std::ostream& alert_stream()
 {
     // Double parentheses: don't parse comma as a macro parameter separator.
-    BOOST_STATIC_ASSERT((boost::is_base_and_derived<alert_buf,T>::value));
+    BOOST_STATIC_ASSERT((std::is_base_of<alert_buf,T>::value));
     static T buffer_;
     static std::ostream stream_(&buffer_);
     stream_.clear();
diff --git a/any_member.hpp b/any_member.hpp
index 06ebbdb..f41a73d 100644
--- a/any_member.hpp
+++ b/any_member.hpp
@@ -69,13 +69,12 @@
 #include "value_cast.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 #include <algorithm>                    // std::lower_bound(), std::swap()
 #include <map>
 #include <sstream>
 #include <stdexcept>
+#include <type_traits>
 #include <vector>
 
 // Definition of class placeholder.
@@ -626,18 +625,18 @@ void MemberSymbolTable<ClassType>::ascribe
     // Double parentheses: don't parse comma as a macro parameter separator.
     BOOST_STATIC_ASSERT
         ((
-        boost::is_base_and_derived
+        std::is_base_of
             <MemberSymbolTable<ClassType>
             ,ClassType
             >::value
         ));
     BOOST_STATIC_ASSERT
         ((
-            boost::is_same
+            std::is_same
                 <SameOrBaseClassType
                 ,ClassType
                 >::value
-        ||  boost::is_base_and_derived
+        ||  std::is_base_of
                 <SameOrBaseClassType
                 ,ClassType
                 >::value
diff --git a/callback.hpp b/callback.hpp
index f85fd43..eb51a5f 100644
--- a/callback.hpp
+++ b/callback.hpp
@@ -29,11 +29,9 @@
 #include "uncopyable_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_function.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
 
 #include <stdexcept>
+#include <type_traits>
 
 /// Design notes for class callback.
 ///
@@ -104,9 +102,9 @@ class LMI_SO callback
     :        private lmi::uncopyable <callback<FunctionPointer> >
     ,virtual private obstruct_slicing<callback<FunctionPointer> >
 {
-    BOOST_STATIC_ASSERT(boost::is_pointer<FunctionPointer>::value);
-    typedef typename boost::remove_pointer<FunctionPointer>::type f_type;
-    BOOST_STATIC_ASSERT(boost::is_function<f_type>::value);
+    BOOST_STATIC_ASSERT(std::is_pointer<FunctionPointer>::value);
+    typedef typename std::remove_pointer<FunctionPointer>::type f_type;
+    BOOST_STATIC_ASSERT(std::is_function<f_type>::value);
 
   public:
     FunctionPointer operator()() const;
diff --git a/ieee754.hpp b/ieee754.hpp
index b31b0f6..34bf260 100644
--- a/ieee754.hpp
+++ b/ieee754.hpp
@@ -25,9 +25,9 @@
 #include "config.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_float.hpp>
 
 #include <limits>
+#include <type_traits>
 
 /// Quiet NaN if available; else a slightly less implausible value.
 ///
@@ -44,7 +44,7 @@
 template<typename T>
 T implausible_value(T const& t = -9.99999e35)
 {
-    BOOST_STATIC_ASSERT(::boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(::std::is_floating_point<T>::value);
 
     if(std::numeric_limits<T>::has_quiet_NaN)
         {
@@ -72,7 +72,7 @@ T implausible_value(T const& t = -9.99999e35)
 template<typename T>
 inline T infinity()
 {
-    BOOST_STATIC_ASSERT(::boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(::std::is_floating_point<T>::value);
     BOOST_STATIC_ASSERT(std::numeric_limits<T>::has_infinity);
     static T const volatile z = std::numeric_limits<T>::infinity();
     return z;
@@ -104,7 +104,7 @@ inline T infinity()
 template<typename T>
 inline bool is_infinite(T t)
 {
-    BOOST_STATIC_ASSERT(::boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(::std::is_floating_point<T>::value);
     static T const volatile pos_inf =  std::numeric_limits<T>::infinity();
     static T const volatile neg_inf = -std::numeric_limits<T>::infinity();
     static bool const has_inf = std::numeric_limits<T>::has_infinity;
diff --git a/input_seq_helpers.hpp b/input_seq_helpers.hpp
index a899e49..5ac3b5d 100644
--- a/input_seq_helpers.hpp
+++ b/input_seq_helpers.hpp
@@ -30,11 +30,11 @@
 #include "so_attributes.hpp"
 #include "tn_range.hpp"
 
-#include <boost/type_traits/is_enum.hpp>
 #include <boost/utility/enable_if.hpp>
 
 #include <map>
 #include <string>
+#include <type_traits>
 #include <vector>
 
 namespace detail
@@ -109,7 +109,7 @@ namespace detail
 template<typename T>
 std::vector<T> convert_vector_type
     (std::vector<mc_enum<T> > const& ve
-    ,typename boost::enable_if<boost::is_enum<T> >::type* = nullptr
+    ,typename boost::enable_if<std::is_enum<T> >::type* = nullptr
     )
 {
     std::vector<T> z;
diff --git a/math_functors.hpp b/math_functors.hpp
index 79e1492..62337a8 100644
--- a/math_functors.hpp
+++ b/math_functors.hpp
@@ -28,12 +28,12 @@
 #include "et_vector.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_float.hpp>
 
 #include <algorithm>                    // std::max(), std::min()
 #include <cmath>                        // C99 expm1(), log1p()
 #include <functional>
 #include <stdexcept>
+#include <type_traits>
 #include <vector>
 
 // For Comeau, implement expm1l() and log1pl() using type double, not
@@ -103,7 +103,7 @@ template<typename T>
 struct mean
     :public std::binary_function<T, T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& x, T const& y) const
         {return 0.5 * x + 0.5 * y;}
 };
@@ -133,7 +133,7 @@ struct mean
 template<typename T, int n>
 struct i_upper_n_over_n_from_i
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     BOOST_STATIC_ASSERT(0 < n);
     T operator()(T const& i) const
         {
@@ -159,7 +159,7 @@ template<typename T>
 struct i_upper_12_over_12_from_i
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         return i_upper_n_over_n_from_i<double,12>()(i);
@@ -170,7 +170,7 @@ template<typename T, int n>
 struct i_from_i_upper_n_over_n
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     BOOST_STATIC_ASSERT(0 < n);
     T operator()(T const& i) const
         {
@@ -185,7 +185,7 @@ template<typename T>
 struct i_from_i_upper_12_over_12
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         return i_from_i_upper_n_over_n<double,12>()(i);
@@ -196,7 +196,7 @@ template<typename T, int n>
 struct d_upper_n_from_i
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     BOOST_STATIC_ASSERT(0 < n);
     T operator()(T const& i) const
         {
@@ -222,7 +222,7 @@ template<typename T>
 struct d_upper_12_from_i
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         return d_upper_n_from_i<double,12>()(i);
@@ -238,7 +238,7 @@ struct d_upper_12_from_i
 template<typename T, int n>
 struct net_i_from_gross
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     BOOST_STATIC_ASSERT(0 < n);
     T operator()(T const& i, T const& spread, T const& fee) const
         {
@@ -289,7 +289,7 @@ template<typename T>
 struct coi_rate_from_q
     :public std::binary_function<T,T,T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& q, T const& max_coi) const
         {
         if(!(0.0 <= max_coi && max_coi <= 1.0))
diff --git a/math_functors_test.cpp b/math_functors_test.cpp
index f747d3b..18b5384 100644
--- a/math_functors_test.cpp
+++ b/math_functors_test.cpp
@@ -34,6 +34,7 @@
 #include <functional>
 #include <iomanip>
 #include <limits>
+#include <type_traits>
 
 // Some of these tests may raise hardware exceptions. That means that
 // edge cases are tested, not that the code tested is invalid for
@@ -59,7 +60,7 @@ template<typename T>
 struct i_upper_12_over_12_from_i_naive
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         long double z = -1.0L + std::pow((1.0L + i), 1.0L / 12.0L);
@@ -71,7 +72,7 @@ template<typename T>
 struct i_from_i_upper_12_over_12_naive
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         long double z = -1.0L + std::pow((1.0L + i), 12.0L);
@@ -83,7 +84,7 @@ template<typename T>
 struct d_upper_12_from_i_naive
     :public std::unary_function<T, T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i) const
         {
         long double z = 12.0L * (1.0L - std::pow(1.0L + i, -1.0L / 12.0L));
@@ -94,7 +95,7 @@ struct d_upper_12_from_i_naive
 template<typename T, int n>
 struct net_i_from_gross_naive
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& i, T const& spread, T const& fee) const
         {
         static long double const reciprocal_n = 1.0L / n;
@@ -114,7 +115,7 @@ template<typename T>
 struct coi_rate_from_q_naive
     :public std::binary_function<T,T,T>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
     T operator()(T const& q, T const& max_coi) const
         {
         if(0.0 == q)
diff --git a/mc_enum.hpp b/mc_enum.hpp
index b891e68..517215a 100644
--- a/mc_enum.hpp
+++ b/mc_enum.hpp
@@ -28,11 +28,11 @@
 
 #include <boost/operators.hpp>
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_enum.hpp>
 
 #include <cstddef>                      // std::size_t
 #include <deque>
 #include <string>
+#include <type_traits>
 #include <vector>
 
 /// This abstract non-template base class serves two design purposes.
@@ -99,7 +99,7 @@ class mc_enum
     ,private boost::equality_comparable<mc_enum<T>, T          >
     ,private boost::equality_comparable<mc_enum<T>, std::string>
 {
-    BOOST_STATIC_ASSERT(boost::is_enum<T>::value);
+    BOOST_STATIC_ASSERT(std::is_enum<T>::value);
 
     friend class mc_enum_test;
     template<typename U> friend std::vector<std::string> const& all_strings();
diff --git a/multidimgrid_safe.hpp b/multidimgrid_safe.hpp
index e1e49a7..c955f6a 100644
--- a/multidimgrid_safe.hpp
+++ b/multidimgrid_safe.hpp
@@ -33,8 +33,8 @@
 
 #include <boost/any.hpp>
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/type_traits/is_same.hpp>
+
+#include <type_traits>
 
 /// MultiDim* type-safe classes
 /// ---------------------------
@@ -261,8 +261,8 @@ class MultiDimAdjustableAxis
     :public BaseAxisType
 {
     BOOST_STATIC_ASSERT(
-        (  boost::is_base_of<MultiDimAxisAny, BaseAxisType>::value
-        || boost::is_same<MultiDimAxisAny, BaseAxisType>::value
+        (  std::is_base_of<MultiDimAxisAny, BaseAxisType>::value
+        || std::is_same   <MultiDimAxisAny, BaseAxisType>::value
         ));
 
   protected:
diff --git a/mvc_controller.tpp b/mvc_controller.tpp
index 3a0e9aa..6010d49 100644
--- a/mvc_controller.tpp
+++ b/mvc_controller.tpp
@@ -27,13 +27,12 @@
 #include "rtti_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 #include <wx/window.h>
 #include <wx/xrc/xmlres.h>
 
+#include <type_traits>
+
 template<typename T>
 T const* MvcController::ModelPointer(std::string const& name) const
 {
@@ -72,13 +71,13 @@ T const& MvcController::ModelReference(std::string const& 
name) const
 template<typename T>
 T& MvcController::WindowFromXrcName(char const* name) const
 {
-    BOOST_STATIC_ASSERT(!boost::is_pointer<T>::value);
+    BOOST_STATIC_ASSERT(!std::is_pointer<T>::value);
 
     // Double parentheses: don't parse comma as a macro parameter separator.
     BOOST_STATIC_ASSERT
         ((
-            boost::is_same<wxWindow,T>::value
-        ||  boost::is_base_and_derived<wxWindow,T>::value
+            std::is_same   <wxWindow,T>::value
+        ||  std::is_base_of<wxWindow,T>::value
         ));
 
     wxWindow* w = FindWindow(wxXmlResource::GetXRCID(name));
diff --git a/numeric_io_cast.hpp b/numeric_io_cast.hpp
index cbea05f..cbb493e 100644
--- a/numeric_io_cast.hpp
+++ b/numeric_io_cast.hpp
@@ -27,17 +27,16 @@
 #include "numeric_io_traits.hpp"
 #include "rtti_lmi.hpp"
 
+#include <boost/static_assert.hpp>
+
 #include <cstring>                      // std::strcmp()
 #include <sstream>
 #include <stdexcept>
 #include <stdio.h>                      // snprintf() (C99, not C++98).
 #include <string>
+#include <type_traits>
 #include <typeinfo>
 
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/type_traits/is_void.hpp>
-
 template<typename To, typename From>
 struct numeric_converter;
 
@@ -122,8 +121,8 @@ To numeric_io_cast(From from, To = To())
 template<typename To, typename From>
 struct numeric_converter
 {
-    BOOST_STATIC_ASSERT(boost::is_void<To>::value);
-    BOOST_STATIC_ASSERT(boost::is_void<From>::value);
+    BOOST_STATIC_ASSERT(std::is_void<To  >::value);
+    BOOST_STATIC_ASSERT(std::is_void<From>::value);
 
     To operator()(From const& from) const
         {
@@ -147,7 +146,7 @@ struct numeric_converter
 template<typename To>
 struct numeric_converter<To, std::string>
 {
-    BOOST_STATIC_ASSERT(boost::is_arithmetic<To>::value);
+    BOOST_STATIC_ASSERT(std::is_arithmetic<To>::value);
 
     typedef std::string From;
     To operator()(From const& from) const
@@ -216,7 +215,7 @@ struct numeric_converter<To, char const*>
 template<typename From>
 struct numeric_converter<std::string, From>
 {
-    BOOST_STATIC_ASSERT(boost::is_arithmetic<From>::value);
+    BOOST_STATIC_ASSERT(std::is_arithmetic<From>::value);
 
     typedef std::string To;
     To operator()(From const& from) const
diff --git a/numeric_io_traits.hpp b/numeric_io_traits.hpp
index 42bb7dd..48c8444 100644
--- a/numeric_io_traits.hpp
+++ b/numeric_io_traits.hpp
@@ -26,6 +26,9 @@
 
 #include "ieee754.hpp"                  // is_infinite<>()
 
+#include <boost/cast.hpp>
+#include <boost/static_assert.hpp>
+
 #include <algorithm>                    // std::max()
 #include <cmath>                        // C99 functions fabsl(), log10l(), 
strtold()
 #include <cstdlib>                      // std::strto*()
@@ -33,10 +36,7 @@
 #include <limits>
 #include <stdexcept>
 #include <string>
-
-#include <boost/cast.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_float.hpp>
+#include <type_traits>
 
 /// Number of exact decimal digits to the right of the decimal point.
 ///
@@ -65,7 +65,7 @@
 template<typename T>
 inline int floating_point_decimals(T t)
 {
-    BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
 #if defined LMI_MSVCRT
     // COMPILER !! This C runtime not only writes infinity as "1.#INF"
     // instead of "inf" but also "respects" the precision specifier
diff --git a/pchlist.hpp b/pchlist.hpp
index ceba53d..eb80025 100644
--- a/pchlist.hpp
+++ b/pchlist.hpp
@@ -106,7 +106,6 @@
 #   include <boost/iterator.hpp>
 #   include <boost/preprocessor.hpp>
 #   include <boost/shared_ptr.hpp>
-#   include <boost/type_traits.hpp>
 #   include <boost/utility.hpp>
 
 #   include <cstddef>
@@ -116,6 +115,7 @@
 #   include <iterator>
 #   include <stdexcept>
 #   include <string>
+#   include <type_traits>
 #   include <utility>
 #   include <vector>
 
diff --git a/round_to.hpp b/round_to.hpp
index aba1119..1591f10 100644
--- a/round_to.hpp
+++ b/round_to.hpp
@@ -28,12 +28,12 @@
 #include "stl_extensions.hpp"           // nonstd::power()
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_float.hpp>
 
 #include <cmath>
 #include <functional>
 #include <limits>
 #include <stdexcept>
+#include <type_traits>
 
 // Round a floating-point number to a given number of decimal places,
 // following a given rounding style.
@@ -284,7 +284,7 @@ template<typename RealType>
 class round_to
     :public std::unary_function<RealType, RealType>
 {
-    BOOST_STATIC_ASSERT(boost::is_float<RealType>::value);
+    BOOST_STATIC_ASSERT(std::is_floating_point<RealType>::value);
 
   public:
     round_to();
diff --git a/safely_dereference_as.hpp b/safely_dereference_as.hpp
index b603fe5..5c63ae8 100644
--- a/safely_dereference_as.hpp
+++ b/safely_dereference_as.hpp
@@ -27,11 +27,10 @@
 #include "rtti_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 #include <sstream>
 #include <stdexcept>
+#include <type_traits>
 
 /// Dereference a non-null pointer, optionally downcasting it.
 ///
@@ -74,8 +73,8 @@ T& safely_dereference_as(U* u)
     // Double parentheses: don't parse comma as a macro parameter separator.
     BOOST_STATIC_ASSERT
         ((
-            boost::is_same            <U,T>::value
-        ||  boost::is_base_and_derived<U,T>::value
+            std::is_same   <U,T>::value
+        ||  std::is_base_of<U,T>::value
         ));
     if(!u)
         {
diff --git a/stream_cast.hpp b/stream_cast.hpp
index c4dd54e..c249bdb 100644
--- a/stream_cast.hpp
+++ b/stream_cast.hpp
@@ -50,13 +50,12 @@
 #include "rtti_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/type_traits/is_pointer.hpp>
 
 #include <istream>                      // std::ws
 #include <sstream>
 #include <stdexcept>
 #include <string>
+#include <type_traits>
 
 /// Design notes for function template stream_cast.
 ///
@@ -101,10 +100,10 @@ template<typename To, typename From>
 To stream_cast(From from, To = To())
 {
     BOOST_STATIC_ASSERT
-        (   !boost::is_arithmetic<From>::value
-        ||  !boost::is_arithmetic<To  >::value
+        (   !std::is_arithmetic<From>::value
+        ||  !std::is_arithmetic<To  >::value
         );
-    BOOST_STATIC_ASSERT(!boost::is_pointer   <To  >::value);
+    BOOST_STATIC_ASSERT(!std::is_pointer<To>::value);
 
     std::stringstream interpreter;
     std::ostringstream err;
diff --git a/tn_range.hpp b/tn_range.hpp
index fe74f44..5a2bc7c 100644
--- a/tn_range.hpp
+++ b/tn_range.hpp
@@ -29,9 +29,9 @@
 #include <boost/operators.hpp>
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
 
 #include <string>
+#include <type_traits>
 #include <typeinfo>
 
 /// Design notes for class template trammel_base.
@@ -238,7 +238,7 @@ class tn_range
 {
     // Double parentheses: don't parse comma as a macro parameter separator.
     BOOST_STATIC_ASSERT
-        ((boost::is_base_and_derived
+        ((std::is_base_of
             <trammel_base<Number>
             ,Trammel
             >::value
diff --git a/tn_range.tpp b/tn_range.tpp
index eafe6d5..f64d6f9 100644
--- a/tn_range.tpp
+++ b/tn_range.tpp
@@ -53,7 +53,7 @@ namespace
     template
         <typename T
         ,bool=std::numeric_limits<T>::is_specialized
-        ,bool=boost::is_float<T>::value
+        ,bool=std::is_floating_point<T>::value
         >
     struct strictly_between_extrema_tester
     {};
@@ -108,7 +108,7 @@ namespace
     template<typename T>
     T signum(T t)
     {
-        BOOST_STATIC_ASSERT(boost::is_arithmetic<T>::value);
+        BOOST_STATIC_ASSERT(std::is_arithmetic<T>::value);
         T volatile zero = 0;
         if(t < zero)
             {
@@ -178,7 +178,7 @@ namespace
     ///   http://groups.google.com/groups?th=1b868327b241fb74
     ///   http://groups.google.com/groups?selm=3DF66B8D.F1C3D2C0%40sun.com
 
-    template<typename T, bool=boost::is_float<T>::value>
+    template<typename T, bool=std::is_floating_point<T>::value>
     struct is_exact_integer_tester
     {};
 
@@ -191,7 +191,7 @@ namespace
     template<typename T>
     struct is_exact_integer_tester<T,true>
     {
-        BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+        BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
         bool operator()(T t)
             {
             static T z0 = std::pow
@@ -220,7 +220,7 @@ namespace
     template<typename T>
     T adjust_bound(T t, T direction)
     {
-        BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+        BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
         if(is_exact_integer(t))
             {
             return t;
@@ -273,7 +273,7 @@ namespace
     template<typename T>
     struct bound_adjuster<T,-1>
     {
-        BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+        BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
         T operator()(T t)
             {
             static T const extremum = -std::numeric_limits<T>::max();
@@ -284,7 +284,7 @@ namespace
     template<typename T>
     struct bound_adjuster<T,1>
     {
-        BOOST_STATIC_ASSERT(boost::is_float<T>::value);
+        BOOST_STATIC_ASSERT(std::is_floating_point<T>::value);
         T operator()(T t)
             {
             static T const extremum = std::numeric_limits<T>::max();
@@ -295,13 +295,13 @@ namespace
     template<typename T>
     T adjust_minimum(T t)
     {
-        return bound_adjuster<T,boost::is_float<T>::value ? -1 : 0>()(t);
+        return bound_adjuster<T,std::is_floating_point<T>::value ? -1 : 
0>()(t);
     }
 
     template<typename T>
     T adjust_maximum(T t)
     {
-        return bound_adjuster<T,boost::is_float<T>::value ? 1 : 0>()(t);
+        return bound_adjuster<T,std::is_floating_point<T>::value ? 1 : 0>()(t);
     }
 } // Unnamed namespace.
 
diff --git a/tn_range_type_trammels.hpp b/tn_range_type_trammels.hpp
index 42455d9..c38410c 100644
--- a/tn_range_type_trammels.hpp
+++ b/tn_range_type_trammels.hpp
@@ -29,9 +29,9 @@
 #include "calendar_date.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 #include <limits>
+#include <type_traits>
 
 // SOMEDAY !! Move this one to a 'test' file.
 
@@ -112,7 +112,7 @@ class date_trammel
     :public trammel_base<T>
 {
     // Double parentheses: don't parse comma as a macro parameter separator.
-    BOOST_STATIC_ASSERT((boost::is_same<calendar_date,T>::value));
+    BOOST_STATIC_ASSERT((std::is_same<calendar_date,T>::value));
 
     T nominal_minimum() const {return gregorian_epoch();}
     T default_value()   const {return today          ();}
diff --git a/uncopyable_lmi.hpp b/uncopyable_lmi.hpp
index 8d0df2d..b674683 100644
--- a/uncopyable_lmi.hpp
+++ b/uncopyable_lmi.hpp
@@ -23,7 +23,8 @@
 #include "config.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
+
+#include <type_traits>
 
 /// Forbid compiler to generate copy and assignment functions.
 ///
@@ -99,7 +100,7 @@ class uncopyable
     ~uncopyable()
         {
         // Double parentheses: don't parse comma as a macro parameter 
separator.
-        
BOOST_STATIC_ASSERT((boost::is_base_and_derived<uncopyable<T>,T>::value));
+        BOOST_STATIC_ASSERT((std::is_base_of<uncopyable<T>,T>::value));
         }
 
   private:
diff --git a/view_ex.tpp b/view_ex.tpp
index 370a8de..6b0ecaf 100644
--- a/view_ex.tpp
+++ b/view_ex.tpp
@@ -24,11 +24,11 @@
 #include "rtti_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
 
 #include <wx/docview.h>
 
 #include <string>
+#include <type_traits>
 #include <typeinfo>
 
 // WX !! Exceptions thrown here seem to be regenerated ad infinitum.
@@ -52,7 +52,7 @@ template<typename ViewType>
 std::string ViewName()
 {
     // Double parentheses: don't parse comma as a macro parameter separator.
-    BOOST_STATIC_ASSERT((boost::is_base_and_derived<wxView,ViewType>::value));
+    BOOST_STATIC_ASSERT((std::is_base_of<wxView,ViewType>::value));
     return lmi::TypeInfo(typeid(ViewType)).Name();
 }
 
diff --git a/wx_utility.hpp b/wx_utility.hpp
index 9db4b74..6a2e72a 100644
--- a/wx_utility.hpp
+++ b/wx_utility.hpp
@@ -27,15 +27,13 @@
 #include "so_attributes.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_reference.hpp>
 
 #include <wx/event.h>
 #include <wx/string.h>
 
 #include <stdexcept>
 #include <string>
+#include <type_traits>
 #include <vector>
 
 class LMI_SO_FWD_DECL calendar_date;
@@ -83,13 +81,13 @@ void Connect
     )
 {
     // Double parentheses: don't parse comma as a macro parameter separator.
-    BOOST_STATIC_ASSERT((boost::is_same<void,Return>::value));
-    
BOOST_STATIC_ASSERT((boost::is_base_and_derived<wxEvtHandler,Class>::value));
-    typedef typename boost::remove_reference<Argument>::type argument_type;
+    BOOST_STATIC_ASSERT((std::is_same<void,Return>::value));
+    BOOST_STATIC_ASSERT((std::is_base_of<wxEvtHandler,Class>::value));
+    typedef typename std::remove_reference<Argument>::type argument_type;
     BOOST_STATIC_ASSERT
         ((
-            boost::is_same            <wxEvent,argument_type>::value
-        ||  boost::is_base_and_derived<wxEvent,argument_type>::value
+            std::is_same   <wxEvent,argument_type>::value
+        ||  std::is_base_of<wxEvent,argument_type>::value
         ));
 
     if(!object)
diff --git a/xml_serializable.tpp b/xml_serializable.tpp
index 47d4bc4..10baad3 100644
--- a/xml_serializable.tpp
+++ b/xml_serializable.tpp
@@ -29,8 +29,6 @@
 
 #include <boost/filesystem/convenience.hpp> // basename()
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_same.hpp>
 #include <boost/utility/enable_if.hpp>
 
 #include <xmlwrapp/nodes_view.h>
@@ -38,6 +36,7 @@
 #include <algorithm>                    // std::copy(), std::find()
 #include <iterator>                     // std::back_inserter
 #include <sstream>
+#include <type_traits>
 #include <vector>
 
 template<typename T>
@@ -50,8 +49,8 @@ xml_serializable<T>::~xml_serializable()
     // Double parentheses: don't parse comma as a macro parameter separator.
     BOOST_STATIC_ASSERT
         ((
-           boost::is_base_and_derived<xml_serializable <T>,T>::value
-        && boost::is_base_and_derived<MemberSymbolTable<T>,T>::value
+           std::is_base_of<xml_serializable <T>,T>::value
+        && std::is_base_of<MemberSymbolTable<T>,T>::value
         ));
 }
 
@@ -215,7 +214,7 @@ std::string const& xml_serializable<T>::xml_root_name() 
const
 template<typename X, typename Y>
 inline Y sfinae_cast
     (X const& x
-    ,typename boost::enable_if<boost::is_same<X,Y> >::type* = nullptr
+    ,typename boost::enable_if<std::is_same<X,Y> >::type* = nullptr
     )
 {
     return x;
@@ -224,7 +223,7 @@ inline Y sfinae_cast
 template<typename X, typename Y>
 inline Y sfinae_cast
     (X const&
-    ,typename boost::disable_if<boost::is_same<X,Y> >::type* = nullptr
+    ,typename boost::disable_if<std::is_same<X,Y> >::type* = nullptr
     )
 {
     fatal_error() << "Impermissible type conversion." << LMI_FLUSH;
diff --git a/xml_serialize.hpp b/xml_serialize.hpp
index a37732a..fac654d 100644
--- a/xml_serialize.hpp
+++ b/xml_serialize.hpp
@@ -29,11 +29,11 @@
 #include "xml_lmi.hpp"
 
 #include <boost/static_assert.hpp>
-#include <boost/type_traits/is_enum.hpp>
 
 #include <xmlwrapp/nodes_view.h>
 
 #include <string>
+#include <type_traits>
 #include <vector>
 
 /// Serialization to and from xml.
@@ -58,7 +58,7 @@ namespace xml_serialize
 template<typename T>
 struct xml_io
 {
-    BOOST_STATIC_ASSERT(!boost::is_enum<T>::value); // Prefer mc_enum.
+    BOOST_STATIC_ASSERT(!std::is_enum<T>::value); // Prefer mc_enum.
 
     static void to_xml(xml::element& e, T const& t)
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]