Android NDK C++11 build fails to compile on std::log1p in MathFunctions.h (dev branch)
Submitted by Tim Chernov (SE)
Assigned to Nobody
Link to original bugzilla bug (#876)
Operating system: Android
Description
Here's the code of atanh2_impl in MathFunctions.h (starts at line 362)
/****************************************************************************
- Implementation of atanh2 *
****************************************************************************/
template<typename Scalar>
struct atanh2_impl
{
static inline Scalar run(const Scalar& x, const Scalar& r)
{
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
#if (__cplusplus >= 201103L) && !defined(CYGWIN)
using std::log1p;
return log1p(2 * x / (r - x)) / 2;
#else
using std::abs;
using std::log;
using std::sqrt;
Scalar z = x / r;
if (r == 0 || abs(z) > sqrt(NumTraits<Scalar>::epsilon()))
return log((r + x) / (r - x)) / 2;
else
return z + zzz / 3;
#endif
}
};
Here's a compilation error:
workdir/Eigen/src/Core/MathFunctions.h>: In static member function 'static Scalar Eigen::internal::atanh2_impl<Scalar>::run(const Scalar&, const Scalar&)':
workdir/Eigen/src/Core/MathFunctions.h>:373:18: error: 'std::log1p' has not been declared
using std::log1p;
I guess it's not enough to just check the C++ version, maybe not-android check should be done as well.