Make it possible to generate constexpr signatures in C++11 mode

The current C++14 constexpr signatures don't require relaxed constexpr,
but only `auto` return type deduction. To get around this in C++11,
the type caster's `name()` static member functions are turned into
`static constexpr auto` variables.
This commit is contained in:
Dean Moldovan
2017-07-02 11:48:56 +02:00
parent f94d759881
commit c10ac6cf1f
9 changed files with 103 additions and 178 deletions

View File

@@ -75,10 +75,8 @@ public:
return cpp_function(std::forward<Func>(f_), policy).release();
}
PYBIND11_TYPE_CASTER(type, _("Callable[[") +
argument_loader<Args...>::arg_names() + _("], ") +
make_caster<retval_type>::name() +
_("]"));
PYBIND11_TYPE_CASTER(type, _("Callable[[") + argument_loader<Args...>::arg_names + _("], ")
+ make_caster<retval_type>::name + _("]"));
};
NAMESPACE_END(detail)