[multiprecision review] EOF not declared, and noexcept errors

Dear All, I'm trying to do some simple tests with the proposed Boost.Multiprecision, but anything that includes e.g. boost/multiprecision/cpp_int.hpp gives errors like this: /big_number/boost/multiprecision/mp_number.hpp:1730:11: error: ‘EOF’ was not declared in this scope /big_number/boost/multiprecision/rational_adapter.hpp:208:45: error: expected ‘;’ at end of member declaration /big_number/boost/multiprecision/rational_adapter.hpp:208:47: error: ‘noexcept’ does not name a type My guess is that the EOF error may be a missing include, while the latter two errors may be something that's missing in the relatively old Boost installation on this test machine. Can anyone suggest what I need to do? Regards, Phil.

I'm trying to do some simple tests with the proposed Boost.Multiprecision, but anything that includes e.g. boost/multiprecision/cpp_int.hpp gives errors like this:
Thanks for your efforts, Phil. What compiler? Which boost?
/big_number/boost/multiprecision/mp_number.hpp:1730:11: error: ‘EOF’ was not declared in this scope
EOF is an old-school macro defined in <stdio.h>. It must be in <cstdio> with C++11's C99 compatibility.
/big_number/boost/multiprecision/rational_adapter.hpp:208:45: error: expected ‘;’ at end of member declaration
For some strange reason, the compiler does not like (min)() --- even with the well-known MSVC workaround of parentheses.
/big_number/boost/multiprecision/rational_adapter.hpp:208:47: error: ‘noexcept’ does not name a type
It almost seems like you might have some macros activated when they shouldn't be. As far as I know, noexcept is C++11 and it only gets activated if BOOST_NO_NOEXCEPT is *not* defined. BOOST_NO_NOEXCEPT subsequently defines BOOST_MP_NOEXCEPT as nothing (empty), which is what you want.
My guess is that the EOF error may be a missing include, while the latter two errors may be something that's missing in the relatively old Boost installation on this test machine. Can anyone suggest what I need to do? Regards, Phil.
Just to move forward in the diagnosis, could you please perhaps try something? It's not the solution, but might show what's going on... Above the #include <boost/multiprecisioni/cpp_int.hpp> * #define EOF -1 * #define BOOST_NO_NOEXCEPT * #undef min * #undef maxMaybe this will shed more light on the exact situation at hand. Best regards, Chris.

On Wed, Jun 13, 2012 at 12:43 PM, Christopher Kormanyos <e_float@yahoo.com>wrote: [...]
It almost seems like you might have some macros activated when they shouldn't be. As far as I know, noexcept is C++11 and it only gets activated if BOOST_NO_NOEXCEPT is *not* defined. BOOST_NO_NOEXCEPT subsequently defines BOOST_MP_NOEXCEPT as nothing (empty), which is what you want.
A tangent to the original post: Why use BOOST_MP_NOEXCEPT rather than BOOST_NOEXCEPT [1]? - Jeff [1] http://www.boost.org/doc/libs/1_49_0/libs/config/doc/html/boost_config/boost...

It almost seems like you might have some macros activated when they shouldn't be. As far as I know, noexcept is C++11 and it only gets activated if BOOST_NO_NOEXCEPT is *not* defined. BOOST_NO_NOEXCEPT subsequently defines BOOST_MP_NOEXCEPT as nothing (empty), which is what you want.
A tangent to the original post: Why use BOOST_MP_NOEXCEPT rather than BOOST_NOEXCEPT [1]?
Embarrassingly I have no idea, testing the change now. Possibly I wrote the code before those helpers were added, or more likely I just didn't spot them :-( John.

I'm trying to do some simple tests with the proposed Boost.Multiprecision, but anything that includes e.g. boost/multiprecision/cpp_int.hpp gives errors like this:
/big_number/boost/multiprecision/mp_number.hpp:1730:11: error: â?~EOFâ?T was not declared in this scope /big_number/boost/multiprecision/rational_adapter.hpp:208:45: error: expected â?~;â?T at end of member declaration /big_number/boost/multiprecision/rational_adapter.hpp:208:47: error: â?~noexceptâ?T does not name a type
My guess is that the EOF error may be a missing include, while the latter two errors may be something that's missing in the relatively old Boost installation on this test machine. Can anyone suggest what I need to do?
I need to #include <iostream> and possibly <cstdio> in my headers, will fix. The rational_adapter.hpp error is very likely because your boost install predates the introduction of BOOST_NO_NOEXCEPT to Boost.Config - try defining that in your program or adding it to boost/config/user.hpp. HTH, John.
participants (4)
-
Christopher Kormanyos
-
Jeffrey Lee Hellrung, Jr.
-
John Maddock
-
Phil Endecott