Closed shawn-mcadam closed 4 years ago
Thank you @ssm259 both for the report and diagnosis. This will be fixed shortly.
@NAThompson I just realized I probably should have submitted this via a separate branch and then requested a PR to develop
. My apologies for any inconvenience - feel free to make any changes or delete this commit.
@pulver : You're right that would've been better, but my feeling aren't hurt.
@ssm259 : Is the issue fixed for you?
@ssm259 : Is the issue fixed for you?
In case you are testing against a slightly older version of boost, you may have to manually define BOOST_IF_CONSTEXPR
like so prior to the #include
, which was only recently added:
#include <boost/config.hpp>
//
// C++17 if constexpr
//
#if !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
# define BOOST_IF_CONSTEXPR if constexpr
#else
# define BOOST_IF_CONSTEXPR if
#endif
#include <boost/math/differentiation/autodiff.hpp>
@pulver @NAThompson commit d739449 seems to have fixed things. Thanks, guys!
When compiled with -std=c++11 or c++14 every math function in this code
produces error in g++ 10.2.0 (the specific command being
g++-10 -std=c++11 -I/usr/local/include fvar_order_0.cpp
) along the lines ofand similar errors occur with the same standards in clang 11.0.3
The code compiles without a problem when using -std=c++17 or c++20. I think the problem is that each of those functions has a line like
and since BOOST_AUTODIFF_IF_CONSTEXPR is null in c++11 and c++14 the compiler will try calling
make_fvar<double,-1>()
. The main problem is just that the error messages are really confusing, so I'd be happy with something along the lines of astatic_assert(ORDER != 0,"")
. Thank you!