191
191
// in our -pure-cpp2 "import std;" simulation mode... if you need this,
192
192
// use mixed mode (not -pure-cpp2) and #include all the headers you need
193
193
// including this one
194
- //
194
+ //
195
195
// #include <execution>
196
196
#endif
197
197
@@ -629,6 +629,8 @@ class out {
629
629
[](auto && obj, auto && ...params) CPP2_FORCE_INLINE -> decltype (auto ) { \
630
630
if constexpr (requires { std::forward<decltype (obj)>(obj).FUNCNAME (std::forward<decltype (params)>(params)...); }) { \
631
631
return std::forward<decltype (obj)>(obj).FUNCNAME (std::forward<decltype (params)>(params)...); \
632
+ } else if constexpr (requires { std::forward<decltype (*obj)>(*obj).FUNCNAME (std::forward<decltype (params)>(params)...); }) { \
633
+ return std::forward<decltype (*obj)>(*obj).FUNCNAME (std::forward<decltype (params)>(params)...); \
632
634
} else { \
633
635
return FUNCNAME (std::forward<decltype (obj)>(obj), std::forward<decltype (params)>(params)...); \
634
636
} \
@@ -638,6 +640,8 @@ class out {
638
640
[](auto && obj) CPP2_FORCE_INLINE -> decltype (auto ) { \
639
641
if constexpr (requires { std::forward<decltype (obj)>(obj).FUNCNAME (); }) { \
640
642
return std::forward<decltype (obj)>(obj).FUNCNAME (); \
643
+ } else if constexpr (requires { std::forward<decltype (*obj)>(*obj).FUNCNAME (); }) { \
644
+ return std::forward<decltype (*obj)>(*obj).FUNCNAME (); \
641
645
} else { \
642
646
return FUNCNAME (std::forward<decltype (obj)>(obj)); \
643
647
} \
@@ -649,6 +653,8 @@ class out {
649
653
[](auto && obj, auto && ...params) CPP2_FORCE_INLINE -> decltype (auto ) { \
650
654
if constexpr (requires { std::forward<decltype (obj)>(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (params)>(params)...); }) { \
651
655
return std::forward<decltype (obj)>(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (params)>(params)...); \
656
+ } else if constexpr (requires { std::forward<decltype (*obj)>(*obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (params)>(params)...); }) { \
657
+ return std::forward<decltype (*obj)>(*obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (params)>(params)...); \
652
658
} else { \
653
659
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (obj)>(obj), std::forward<decltype (params)>(params)...); \
654
660
} \
@@ -658,6 +664,8 @@ class out {
658
664
[](auto && obj) CPP2_FORCE_INLINE -> decltype (auto ) { \
659
665
if constexpr (requires { std::forward<decltype (obj)>(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); }) { \
660
666
return std::forward<decltype (obj)>(obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); \
667
+ } else if constexpr (requires { std::forward<decltype (*obj)>(*obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); }) { \
668
+ return std::forward<decltype (*obj)>(*obj).template FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (); \
661
669
} else { \
662
670
return FUNCNAME CPP2_UFCS_REMPARENS TEMPARGS (std::forward<decltype (obj)>(obj)); \
663
671
} \
@@ -731,17 +739,17 @@ auto is( X const& ) -> bool {
731
739
732
740
template < typename C, typename X >
733
741
requires (
734
- ( std::is_base_of_v<X, C> ||
735
- ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
742
+ ( std::is_base_of_v<X, C> ||
743
+ ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
736
744
) && !std::is_same_v<C,X>)
737
745
auto is( X const & x ) -> bool {
738
746
return Dynamic_cast<C const *>(&x) != nullptr ;
739
747
}
740
748
741
749
template < typename C, typename X >
742
750
requires (
743
- ( std::is_base_of_v<X, C> ||
744
- ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
751
+ ( std::is_base_of_v<X, C> ||
752
+ ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>)
745
753
) && !std::is_same_v<C,X>)
746
754
auto is( X const * x ) -> bool {
747
755
return Dynamic_cast<C const *>(x) != nullptr ;
@@ -1314,7 +1322,7 @@ inline auto to_string(std::string const& s) -> std::string const&
1314
1322
1315
1323
template <typename T>
1316
1324
inline auto to_string (T const & sv) -> std::string
1317
- requires (std::is_convertible_v<T, std::string_view>
1325
+ requires (std::is_convertible_v<T, std::string_view>
1318
1326
&& !std::is_convertible_v<T, const char *>)
1319
1327
{
1320
1328
return std::string{sv};
0 commit comments