Skip to content

Commit

Permalink
add guard
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Dec 12, 2024
1 parent ce2b35f commit c3f8129
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/pybind11/detail/descr.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ constexpr enable_if_t<!B, T2> const_name(const T1 &, const T2 &d) {
return d;
}

#if defined(PYBIND11_CPP17)

template <auto Bool,
typename std::enable_if<std::is_same<decltype(Bool), bool>::value, int>::type = 0>
auto constexpr const_name() {
Expand All @@ -97,6 +99,9 @@ auto constexpr const_name() {

template <auto Size,
typename std::enable_if<!std::is_same<decltype(Size), bool>::value, int>::type = 0>
#elif
template <size_t Size>
#endif
auto constexpr const_name() -> remove_cv_t<decltype(int_to_str<Size / 10, Size % 10>::digits)> {
return int_to_str<Size / 10, Size % 10>::digits;
}
Expand Down

0 comments on commit c3f8129

Please sign in to comment.