[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 24091aa 1/4: Use <type_traits> instead of <bo
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 24091aa 1/4: Use <type_traits> instead of <boost/type_traits/*.hpp> (VZ) |
Date: |
Sun, 8 Jan 2017 18:02:24 +0000 (UTC) |
branch: master
commit 24091aa90ef7ed0a0581a9cdcfcdaf9eddbf78e5
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Use <type_traits> instead of <boost/type_traits/*.hpp> (VZ)
---
value_cast.hpp | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/value_cast.hpp b/value_cast.hpp
index 4958286..6d6c861 100644
--- a/value_cast.hpp
+++ b/value_cast.hpp
@@ -28,12 +28,10 @@
#include "stream_cast.hpp"
#include <boost/cast.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/is_pointer.hpp>
#include <sstream>
#include <stdexcept>
+#include <type_traits>
// INELEGANT !! Test the runtime performance of value_cast() compared
// to the other casts it uses, to ensure that its overhead is minimal.
@@ -103,10 +101,10 @@
/// although their rationale is not to increase the expressive power,
/// but merely to work around a compiler defect.
///
-/// All uses of class boost::is_convertible here are commented to avoid
+/// All uses of class std::is_convertible here are commented to avoid
/// confusion due to the surprising order of its template parameters:
/// compare
-/// boost::is_convertible<From,To>(From z)
+/// std::is_convertible<From,To>(From z)
/// to the declarations above. Also see this comment:
/// http://lists.boost.org/Archives/boost/2006/01/99722.php
/// "BTW Its a real pain that the parameter order for is_convertible
@@ -127,7 +125,7 @@ template<typename T>
struct is_string
{
// Here, is_convertible means 'T' is convertible to std::string.
- enum {value = boost::is_convertible<T,std::string>::value};
+ enum {value = std::is_convertible<T,std::string>::value};
};
template<typename T>
@@ -185,21 +183,21 @@ struct value_cast_choice
enum
{
// Here, is_convertible means 'From' is convertible to 'To'.
- convertible = boost::is_convertible<From,To>::value
+ convertible = std::is_convertible<From,To>::value
};
enum
{
both_numeric =
- boost::is_arithmetic<From>::value
- && boost::is_arithmetic<To >::value
+ std::is_arithmetic<From>::value
+ && std::is_arithmetic<To >::value
};
enum
{
one_numeric_one_string =
- boost::is_arithmetic<From>::value && is_string<To >::value
- || boost::is_arithmetic<To >::value && is_string<From>::value
+ std::is_arithmetic<From>::value && is_string<To >::value
+ || std::is_arithmetic<To >::value && is_string<From>::value
};
enum
@@ -250,7 +248,7 @@ struct value_cast_chooser<To,From,e_stream>
template<typename To, typename From>
To value_cast(From const& from)
{
- BOOST_STATIC_ASSERT(!boost::is_pointer<To>::value);
+ BOOST_STATIC_ASSERT(!std::is_pointer<To>::value);
return value_cast_chooser<To,From>()(from);
}