Lexical Cast: remove use of boost::mpl

The code was checking that the From type was either char* or const char*. Replaced it
with an equality check against char* with the const stripped from From so both match.

(cherry-picked from commit c57a175fee)
This commit is contained in:
Charles Dang 2018-04-18 01:40:26 +11:00
parent 17d921f434
commit 16643649ee

View file

@ -53,7 +53,6 @@
#include <sstream>
#include <type_traits>
#include <boost/mpl/set.hpp>
#include <boost/optional.hpp>
#define DEBUG_THROW(id)
@ -194,7 +193,7 @@ struct lexical_caster<
long long
, From
, void
, std::enable_if_t<boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value>
, std::enable_if_t<std::is_same<char*, std::remove_const_t<From>>::value>
>
{
long long operator()(From value, boost::optional<long long> fallback) const
@ -250,7 +249,7 @@ struct lexical_caster<
To
, From
, std::enable_if_t<std::is_integral<To>::value && std::is_signed<To>::value && !std::is_same<To, long long>::value>
, std::enable_if_t<boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value>
, std::enable_if_t<std::is_same<char*, std::remove_const_t<From>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const
@ -308,7 +307,7 @@ struct lexical_caster<
To
, From
, std::enable_if_t<std::is_floating_point<To>::value>
, std::enable_if_t<boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value>
, std::enable_if_t<std::is_same<char*, std::remove_const_t<From>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const
@ -377,7 +376,7 @@ struct lexical_caster<
unsigned long long
, From
, void
, std::enable_if_t<boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value>
, std::enable_if_t<std::is_same<char*, std::remove_const_t<From>>::value>
>
{
unsigned long long operator()(From value, boost::optional<unsigned long long> fallback) const
@ -434,7 +433,7 @@ struct lexical_caster<
To
, From
, std::enable_if_t<std::is_unsigned<To>::value && !std::is_same<To, unsigned long long>::value>
, std::enable_if_t<boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value>
, std::enable_if_t<std::is_same<char*, std::remove_const_t<From>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const