The Boost Numeric Conversion library is a collection of tools to describe and perform conversions between values of different numeric types.
The documentation for the library can be found here
Boost.NumericConversion
The Boost Numeric Conversion library is a collection of tools to describe and perform conversions between values of different numeric types.
The documentation for the library can be found here
This issue suggests that the enums being used with mpl::integral_c need two additional cases. The problem was detected by the newest Clang in trunk.
Complete list of warnings when Boost 1.72 is built with GCC 7.5 with -Wsuggest-override
added to cxxflags
:
./boost/numeric/conversion/converter_policies.hpp:140:26: warning: ‘virtual const char* boost::numeric::bad_numeric_cast::what() const’ can be marked override [-Wsuggest-override] ./boost/numeric/conversion/converter_policies.hpp:148:26: warning: ‘virtual const char* boost::numeric::negative_overflow::what() const’ can be marked override [-Wsuggest-override] ./boost/numeric/conversion/converter_policies.hpp:155:26: warning: ‘virtual const char* boost::numeric::positive_overflow::what() const’ can be marked override [-Wsuggest-override]
BOOST_OVERRIDE
was introduced in boostorg/config@ffe4e0f.
Using the newest Visual Studio 2017 and its C++ compiler:
The errors mean
Could this be a compiler error?
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(453): error C2143: Syntaxfehler: Es fehlt "," vor "
<" [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(467): note: Siehe Verweis auf die Klasse Vorlage-
Instanziierung "boost::numeric::convdetail::trivial_converter_impl<Traits>", die kompiliert wird.
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(453): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(454): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(474): error C2143: Syntaxfehler: Es fehlt "," vor "
<" [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(497): note: Siehe Verweis auf die Klasse Vorlage-
Instanziierung "boost::numeric::convdetail::rounding_converter<Traits,RangeChecker,RawConverter,Float2IntRounder>", d
ie kompiliert wird.
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(474): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(475): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(504): error C2143: Syntaxfehler: Es fehlt "," vor "
<" [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(526): note: Siehe Verweis auf die Klasse Vorlage-
Instanziierung "boost::numeric::convdetail::non_rounding_converter<Traits,RangeChecker,RawConverter>", die kompiliert
wird.
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(504): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/numeric/conversion/detail/converter.hpp(505): error C2518: Schlüsselwort "typename" ist in
der Basisklassenliste ungültig und wird ignoriert [C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
C:\local\boost_1_64_0\boost/algorithm/string/detail/case_conv.hpp(33): error C2143: Syntaxfehler: Es fehlt "," vor "<"
[C:\Users\jtroelsen\ifcconverter\ifcconverter.vcxproj]
TODO: I can't think of any reasons off the top of my head why this wouldn't work. I use numeric_cast to perform scaling conversions for a fixed_point type. This is required for the constructor of the fixed_point to be constexpr.
A fix in the 'develop' branch is for the Embarcadero C++ clang-based compilers.
Boost.Test has deprecated the use of non-header only builds. This is a reminder to change numeric_conversion to use the header only version.
b2 variant=debug address-model=64 toolset=msvc-14.1 libs/numeric/conversion/test//traits_test
boost\libs\numeric\conversion\test\traits_test.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
Either placing <toolset>msvc:<cxxflags>/bigobj
or <toolset>msvc:<debug-symbols>off
solves the problem.
std::unary_function has been removed from C++ 17 standard so it does not compile anymore on MSVC
Setup :
Lastest MSVC
C++ 2017
Thanks to Mylerius for the help.
Merge request : #7
The following testcase against boost 1.61.0:
#include <boost/config/suffix.hpp>
#include <boost/numeric/conversion/cast.hpp>
int main() {
return 0;
}
When compiled with clang++ on OS X with -std=c++11
results in this compile error:
/Users/dane/projects/node-osrm/mason_packages/.link/include/boost/type_traits/is_integral.hpp:75:38: error: no member named 'int128_type' in namespace 'boost'
template<> struct is_integral<boost::int128_type> : public true_type{};
~~~~~~~^
/Users/dane/projects/node-osrm/mason_packages/.link/include/boost/type_traits/is_integral.hpp:76:38: error: no member named 'uint128_type' in namespace 'boost'
template<> struct is_integral<boost::uint128_type> : public true_type{};
When not compiled with -std=c++11
then a different compile error happens:
/Users/dane/projects/node-osrm/mason_packages/.link/include/boost/mpl/aux_/integral_wrapper.hpp:80:5: error: unknown type name 'constexpr'
BOOST_CONSTEXPR operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); }
^
/Users/dane/projects/node-osrm/mason_packages/.link/include/boost/config/suffix.hpp:951:25: note: expanded from macro 'BOOST_CONSTEXPR'
#define BOOST_CONSTEXPR constexpr
Both of the compile errors can be worked around by changing the include order. This works fine:
#include <boost/numeric/conversion/cast.hpp>
#include <boost/config/suffix.hpp>
int main() {
return 0;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.