From 21fc6b31c7f6d1b7554c8cdece2774379a267220 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 22 Jun 2022 08:35:57 -0700 Subject: [PATCH] Mark tu_local_no_data_always_false operator bool as explicit (clang-tidy). See also: https://stackoverflow.com/questions/39995573/when-can-i-use-explicit-operator-bool-without-a-cast --- include/pybind11/detail/type_caster_odr_guard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/detail/type_caster_odr_guard.h b/include/pybind11/detail/type_caster_odr_guard.h index b79f927d3..b8bf87453 100644 --- a/include/pybind11/detail/type_caster_odr_guard.h +++ b/include/pybind11/detail/type_caster_odr_guard.h @@ -107,7 +107,7 @@ constexpr tu_local_descr tu_local_const_name(char const (&text)[N]) { constexpr tu_local_descr<0> tu_local_const_name(char const (&)[1]) { return {}; } struct tu_local_no_data_always_false { - operator bool() const noexcept { return false; } + explicit operator bool() const noexcept { return false; } }; } // namespace