It is better to manage warnings on our side to know what warnings we need to fix or suppress, and the only thing that header does is disabling deprecation warnings on MSVC and ICC which we would prefer to not show to users.
It might cost us backward compatibility with ancient compilers, exotic platforms,
and yield a performance difference on MSVC, but Boost.Math is C++11 now, and
Clang-cl can (or even should) be used instead of MSVC where performance matters.
Win32 only defines the types from wtypes.h, like WCHAR, LPWCSTR, etc.
These may or may not be the same thing as wchar_t.
MinGW, cygwin, and wineg++ all support f(no-)short-wchar,
with the caveat that libstdc++ must be compiled with the same option.
Doing so is quite unusual for MinGW or cygwin, but more common for wineg++
as it enables building a winelib app with system glibc/libstdc++.
Win32's WCHAR is then unsigned short, or with C++11 perhaps char16_t.
MSVC does explicitly document that its wchar_t is always UTF16:
https://docs.microsoft.com/en-us/cpp/cpp/char-wchar-t-char16-t-char32-t?view=vs-2019
C99/C++11 compilers should provide __STDC_ISO_10646__ if wchar_t is unicode
GCC, Clang, and ICC all provide __SIZEOF_WCHAR_T__ to distinguish
-fshort-wchar (defaulted by mingw/cygwin) from -fno-short-wchar
https://gcc.gnu.org/onlinedocs/gcc-9.2.0/cpp/Common-Predefined-Macros.html
This takes the approach of assuming that a 2-byte unicode wchar_t
might be UTF-16 (and still works if its's actually UCS-2, it just never
finds any surrogate pairs), and 4-byte unicode must be UCS-4.
Include needed parts at place where they are needed instead of including the
whole Proto library and significant parts of Phoenix in a few places.
Parsing time reported by Clang 9 with default (C++14) std:
was |now |gain|include
----|----|----|----------
4.45|4.22|5.2%|qi
4.52|4.23|7.5%|karma
4.37|3.99|9.7%|lex
3.75|3.47|7.5%|qi_numeric
There were phoenix/limits.hpp inclusion before every Proto inclusion to override
Proto limits with Phoenix limits values. It has no value in C++11+ world, and
poisons code too much as the number of places where Proto headers now included
increased, so I did not replicate it.
Commit (almost) automatically generated with the following sed command:
sed -i -ne '1h;1!H;${g;s|\n[[:blank:]]*private:\n\([[:blank:]]*\)// silence MSVC warning C4512: assignment operator could not be generated\n\([[:blank:]]*\)\([^\n]\+\);\n|\n\1// silence MSVC warning C4512: assignment operator could not be generated\n\2BOOST_DELETED_FUNCTION(\3);\n|g;p}' $(git ls-files)
Then all files in the x3 subfolder were reverted to HEAD, and manually
updated to use " = delete" instead of BOOST_DELETED_FUNCTION.
The IgnoreOverflowDigits=true parser always succeeds and because of that it
expects from the digits parser that a number passed as inout argument will be
changed only on success.
Changed negative_accumulator and X3 for consistency.