diff --git a/sprout/complex/transcendentals.hpp b/sprout/complex/transcendentals.hpp index c18474e0..57a96cbf 100644 --- a/sprout/complex/transcendentals.hpp +++ b/sprout/complex/transcendentals.hpp @@ -219,16 +219,16 @@ namespace sprout { inline SPROUT_CONSTEXPR sprout::complex log10(sprout::complex const& x) { return sprout::log(x) / sprout::log(T(10)); } + + // + // pow + // namespace detail { template inline SPROUT_CONSTEXPR sprout::complex pow_impl(sprout::complex const& t, T const& y) { return sprout::polar(sprout::exp(y * t.real()), y * t.imag()); } } // namespace detail - - // - // pow - // template inline SPROUT_CONSTEXPR sprout::complex pow(sprout::complex const& x, T const& y) { @@ -295,11 +295,6 @@ namespace sprout { return sprout::detail::sqrt_impl_2_1(x, t, t / 2); } } // namespace detail - - // - // tan - // tanh - // template inline SPROUT_CONSTEXPR sprout::complex sqrt(sprout::complex const& x) { @@ -307,6 +302,11 @@ namespace sprout { : sprout::detail::sqrt_impl_2(x, sprout::sqrt(2 * (sprout::abs(x) + sprout::abs(x.real())))) ; } + + // + // tan + // tanh + // template inline SPROUT_CONSTEXPR sprout::complex tan(sprout::complex const& x) { diff --git a/sprout/config/suffix.hpp b/sprout/config/suffix.hpp index f1850f34..42167652 100644 --- a/sprout/config/suffix.hpp +++ b/sprout/config/suffix.hpp @@ -47,11 +47,14 @@ // // SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS +// SPROUT_EXPLICIT_CONVERSION // #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS # define SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS 1 +# define SPROUT_EXPLICIT_CONVERSION explicit #else // #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS # define SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS 0 +# define SPROUT_EXPLICIT_CONVERSION #endif // #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS // diff --git a/sprout/optional/optional.hpp b/sprout/optional/optional.hpp index 38a6654b..93089a2d 100644 --- a/sprout/optional/optional.hpp +++ b/sprout/optional/optional.hpp @@ -294,7 +294,7 @@ namespace sprout { ; } - SPROUT_CONSTEXPR operator bool() const SPROUT_NOEXCEPT { + SPROUT_EXPLICIT_CONVERSION SPROUT_CONSTEXPR operator bool() const SPROUT_NOEXCEPT { return is_initialized(); } SPROUT_CONSTEXPR bool operator!() const SPROUT_NOEXCEPT { diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index c020b2a2..afcf23a5 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -493,12 +493,10 @@ namespace sprout { sprout::make_index_tuple::make() ); } -#if SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS template - explicit operator std::basic_string() const { + SPROUT_EXPLICIT_CONVERSION operator std::basic_string() const { return std::basic_string(data(), size()); } -#endif pointer c_array() SPROUT_NOEXCEPT { return &elems[0]; diff --git a/sprout/utility/string_ref/string_ref.hpp b/sprout/utility/string_ref/string_ref.hpp index 32e1260f..660ea221 100644 --- a/sprout/utility/string_ref/string_ref.hpp +++ b/sprout/utility/string_ref/string_ref.hpp @@ -390,12 +390,10 @@ namespace sprout { return size() >= str.size() && traits_type::compare(data() + size() - str.size(), str.data(), str.size()) == 0; } // others: -#if SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS template - explicit operator std::basic_string() const { + SPROUT_EXPLICIT_CONVERSION operator std::basic_string() const { return std::basic_string(data(), size()); } -#endif pointer c_array() SPROUT_NOEXCEPT { return data();