Skip to content

Commit

Permalink
Changed io_name to have explicit return type (for C++11 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Jan 9, 2025
1 parent 0a677e7 commit 8b3bd83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/pybind11/detail/descr.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ constexpr descr<1, Type> const_name() {

// Use a different name based on whether the parameter is used as input or output
template <size_t N1, size_t N2>
constexpr auto io_name(char const (&text1)[N1], char const (&text2)[N2]) {
constexpr descr<N1 + N2 + 1> io_name(char const (&text1)[N1], char const (&text2)[N2]) {
return const_name("@") + const_name(text1) + const_name("@") + const_name(text2)
+ const_name("@");
}
Expand Down Expand Up @@ -163,8 +163,9 @@ constexpr auto concat(const descr<N, Ts...> &d, const Args &...args) {
}
#else
template <size_t N, typename... Ts, typename... Args>
constexpr auto concat(const descr<N, Ts...> &d, const Args &...args)
-> decltype(std::declval<descr<N + 2, Ts...>>() + concat(args...)) {
constexpr auto concat(const descr<N, Ts...> &d,
const Args &...args) -> decltype(std::declval<descr<N + 2, Ts...>>()
+ concat(args...)) {
return d + const_name(", ") + concat(args...);
}
#endif
Expand Down

0 comments on commit 8b3bd83

Please sign in to comment.