lexical_caster overloads
Discussion of all aspects of the game engine, including development of new and existing features.
Moderator: Forum Moderators
lexical_caster overloads
Commits c57a175fee701b4d19c09653a5c9445b778d139e and a7e1ff85ed10fa56512583648727155a54a2b0cd made the following change:
Isn't this a bug? The patch enabled those overloads for the case that
Spoiler:
Code: Select all
diff -u b/src/lexical_cast.hpp b/src/lexical_cast.hpp
--- b/src/lexical_cast.hpp
+++ b/src/lexical_cast.hpp
@@ -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 @@
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<std::remove_pointer_t<From>>>::value>
>
{
long long operator()(From value, boost::optional<long long> fallback) const
@@ -250,7 +249,7 @@
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<std::remove_pointer_t<From>>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const
@@ -308,7 +307,7 @@
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<std::remove_pointer_t<From>>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const
@@ -377,7 +376,7 @@
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<std::remove_pointer_t<From>>>::value>
>
{
unsigned long long operator()(From value, boost::optional<unsigned long long> fallback) const
@@ -434,7 +433,7 @@
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<std::remove_pointer_t<From>>>::value>
>
{
To operator()(From value, boost::optional<To> fallback) const
From
is char
, butthe body of the operator()
won't compile in that case.
Post Reply
1 post
• Page 1 of 1
Jump to
- Announcements
- ↳ News
- General
- ↳ Users’ Forum
- ↳ Tournaments
- ↳ Release Announcements, Compiling & Installation
- ↳ Technical Support
- ↳ iOS Support
- ↳ Strategies & Tips
- ↳ Gameplay Feedback
- ↳ Mainline Campaign Feedback
- ↳ Tutorial
- ↳ A Tale of Two Brothers
- ↳ An Orcish Incursion
- ↳ The South Guard
- ↳ Heir to the Throne
- ↳ Liberty
- ↳ Legend of Wesmere (single player)
- ↳ Legend of Wesmere (multiplayer)
- ↳ Eastern Invasion
- ↳ The Hammer of Thursagan
- ↳ Descent into Darkness
- ↳ Delfador’s Memoirs
- ↳ Dead Water
- ↳ Secrets of the Ancients
- ↳ Sceptre of Fire
- ↳ Son of the Black Eye
- ↳ The Rise of Wesnoth
- ↳ Northern Rebirth
- ↳ Under the Burning Suns
- ↳ Winds of Fate
- ↳ Add-on Feedback
- ↳ Website
- Development
- ↳ Art Contributions
- ↳ Art Workshop
- ↳ Writers’ Forum
- ↳ WML Workshop
- ↳ Lua Labs
- ↳ Faction & Era Development
- ↳ Multiplayer Development
- ↳ Scenario & Campaign Development
- ↳ Mainline Campaign Development
- ↳ UMC Replays
- ↳ Music & Sound Development
- ↳ Translations & Internationalization
- ↳ Translation Stats
- ↳ Ideas
- ↳ Coder’s Corner
- ↳ Developers’ Discussions
- ↳ Wesnoth Organizational Updates
- ↳ Art Development
- Miscellaneous
- ↳ Game Development
- ↳ Off-Topic
- ↳ Forum Games