Skip to content

Commit 85011ae

Browse files
committed
Work around compilation with gcc-4.8, render nans in c++14 mode only
1 parent a30af8f commit 85011ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/pybind11/cast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ struct arg_v : arg {
18711871
arg_v(const arg &base, T &&x, const char *descr = nullptr)
18721872
: arg_v(arg(base), std::forward<T>(x), descr) { }
18731873

1874-
#if __cplusplus >= 201103L
1874+
#if __cplusplus >= 201402L
18751875
#define ARGV_NAN_DEFAULT_OVERLOAD(FLOAT_TYPE) \
18761876
arg_v(const arg &base, FLOAT_TYPE x) \
18771877
: arg_v(arg(base), x, std::isnan(x) ? "numpy.nan" : nullptr) {}

tests/test_kwargs_and_defaults.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
3535
m.def("kw_func_udl_z", kw_func, "x"_a, "y"_a=0);
3636

3737
m.def("kw_func_float_123", kw_func_float, "x"_a=1, "y"_a=2, "z"_a=3);
38-
#if __cplusplus >= 201103L
38+
#if __cplusplus >= 201402L
3939
m.def("kw_func_float_nan", kw_func_float,
4040
"x"_a=std::numeric_limits<float>::quiet_NaN(),
4141
"y"_a=std::numeric_limits<double>::quiet_NaN(),

0 commit comments

Comments
 (0)