This reverts commit 9d0c70fb4861cec7a9f46443f1e59c5ace6ada5d.
That commit was wrong.
std::is_same<char, std::remove_const_t<std::remove_pointer_t<From>>>::value
is not equivalent to
boost::mpl::has_key<boost::mpl::set<char*, const char*> , From>::value
because the former is true not just for 'char*' and 'const char*' but
also for 'char'.
(cherry-picked from commit eacbc5f695)
Turns out remove_const alone only removes the const from the pointer, not from the type
itself, so the expression wasn't returning true. This strips the pointer out before removing
const and matches against char instead of char*
(cherry-picked from commit a7e1ff85ed)
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 completely removes the wrappers for aliases included in c++14. It also enables
use of the value alias wrappers, since we now have variable templates.
(cherry-picked from commit c1fcba17b7)
We have needed to suppress it in a bunch of places because GCC has kept
giving false positives depending on optimization settings. When I noticed
yet another false positive when I attempted to build the game with PGO
profiling data using CMake, it was the last straw.
Let's just suppress the warning globally and move on with our lives.
`#pragma once` isn't a good fit for this file since it's designed to be parsed multiple times if
LEXICAL_CAST_DEBUG is defined. pragma does not allow that once `once` has been encountered once.
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.
For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
As pointed out, it makes slightly more sense to keep it as two functions than one function that could
throw if the second argument were not provided. Another benefit is it allows lexical_cast_default to retain
the default T() fallback in the case where no manual fallback were provided. Whether this is desirable
behavior can be looked at later
This commit also fixes a problem in 87405f8f89 where the fallback value wasn't propagated through certain
specializations that called lexical_cast instead of performing the conversion themselves.