@@ -520,6 +520,12 @@ template <class A1, class A2>
520
520
using merged_composite_accessor =
521
521
typename composite_accessor_merge_traits<A1, A2>::type;
522
522
523
+ template <class T > struct in_place_type_traits : inapplicable_traits {};
524
+ template <class T >
525
+ struct in_place_type_traits <std::in_place_type_t <T>> : applicable_traits {};
526
+ template <class T >
527
+ constexpr bool is_in_place_type = in_place_type_traits<T>::applicable;
528
+
523
529
template <class F >
524
530
consteval bool is_facade_constraints_well_formed () {
525
531
if constexpr (requires {
@@ -782,14 +788,15 @@ class proxy : public details::facade_traits<F>::direct_accessor {
782
788
}
783
789
template <class P >
784
790
proxy (P&& ptr) noexcept (std::is_nothrow_constructible_v<std::decay_t <P>, P>)
785
- requires (proxiable<std::decay_t <P>, F> &&
786
- std::is_constructible_v<std::decay_t <P>, P>) : proxy()
787
- { initialize<std::decay_t <P>>(std::forward<P>(ptr)); }
791
+ requires (!details::is_in_place_type<std::decay_t <P>> &&
792
+ proxiable<std::decay_t <P>, F> &&
793
+ std::is_constructible_v<std::decay_t <P>, P>)
794
+ : proxy() { initialize<std::decay_t <P>>(std::forward<P>(ptr)); }
788
795
template <proxiable<F> P, class ... Args>
789
796
explicit proxy (std::in_place_type_t <P>, Args&&... args)
790
797
noexcept (std::is_nothrow_constructible_v<P, Args...>)
791
- requires(std::is_constructible_v<P, Args...>) : proxy()
792
- { initialize<P>(std::forward<Args>(args)...); }
798
+ requires(std::is_constructible_v<P, Args...>)
799
+ : proxy() { initialize<P>(std::forward<Args>(args)...); }
793
800
template <proxiable<F> P, class U , class ... Args>
794
801
explicit proxy (std::in_place_type_t <P>, std::initializer_list<U> il,
795
802
Args&&... args)
@@ -1258,8 +1265,6 @@ template <class F, class C>
1258
1265
using adl_accessor_arg_t =
1259
1266
std::conditional_t <C::is_direct, proxy<F>, proxy_indirect_accessor<F>>;
1260
1267
1261
- template <class O >
1262
- using overload_return_type = typename overload_traits<O>::return_type;
1263
1268
#define ___PRO_DEF_CAST_ACCESSOR (Q, SELF, ...) \
1264
1269
template <class __F , class __C , class T > \
1265
1270
struct accessor <__F, __C, T() Q> { \
@@ -1274,7 +1279,7 @@ using overload_return_type = typename overload_traits<O>::return_type;
1274
1279
template <bool Expl, bool Nullable>
1275
1280
struct cast_dispatch_base {
1276
1281
___PRO_DEF_MEM_ACCESSOR_TEMPLATE (___PRO_DEF_CAST_ACCESSOR,
1277
- operator overload_return_type <__Os>)
1282
+ operator typename overload_traits <__Os>::return_type )
1278
1283
};
1279
1284
#undef ___PRO_DEF_CAST_ACCESSOR
1280
1285
@@ -1468,11 +1473,10 @@ struct observer_overload_mapping_traits<F, IS_DIRECT, D, O>
1468
1473
: observer_overload_mapping_traits_impl<F, IS_DIRECT, D, O> {};
1469
1474
template <class F , class O >
1470
1475
struct observer_overload_mapping_traits <F, true , upward_conversion_dispatch, O>
1471
- : std::type_identity<proxy_view<
1472
- std::conditional_t <std::is_const_v<F>,
1473
- const facade_of_t <typename overload_traits<O>::return_type>,
1474
- facade_of_t <typename overload_traits<O>::return_type>
1475
- >>() const noexcept > {};
1476
+ : std::type_identity<proxy_view<std::conditional_t <std::is_const_v<F>,
1477
+ const facade_of_t <typename overload_traits<O>::return_type>,
1478
+ facade_of_t <typename overload_traits<O>::return_type>>>()
1479
+ const noexcept > {};
1476
1480
1477
1481
template <class D >
1478
1482
struct observer_dispatch_reduction : std::type_identity<D> {};
@@ -1702,22 +1706,20 @@ struct basic_facade_builder {
1702
1706
using support_destruction = basic_facade_builder<
1703
1707
Cs, Rs, details::make_destructible(C, CL)>;
1704
1708
#ifdef __cpp_rtti
1705
- using support_indirect_rtti =
1706
- basic_facade_builder<
1707
- details::add_conv_t <Cs, details::conv_impl<false ,
1708
- details::proxy_cast_dispatch, void (details::proxy_cast_context) &,
1709
- void (details::proxy_cast_context) const &,
1710
- void(details::proxy_cast_context) &&>>,
1711
- details::add_tuple_t<Rs, details::refl_impl<false,
1712
- details::proxy_typeid_reflector>>, C>;
1713
- using support_direct_rtti =
1714
- basic_facade_builder<
1715
- details::add_conv_t <Cs, details::conv_impl<true ,
1716
- details::proxy_cast_dispatch, void (details::proxy_cast_context) &,
1717
- void (details::proxy_cast_context) const &,
1718
- void(details::proxy_cast_context) &&>>,
1719
- details::add_tuple_t<Rs, details::refl_impl<true,
1720
- details::proxy_typeid_reflector>>, C>;
1709
+ using support_indirect_rtti = basic_facade_builder<
1710
+ details::add_conv_t <Cs, details::conv_impl<false ,
1711
+ details::proxy_cast_dispatch, void (details::proxy_cast_context) &,
1712
+ void (details::proxy_cast_context) const &,
1713
+ void(details::proxy_cast_context) &&>>,
1714
+ details::add_tuple_t<Rs, details::refl_impl<false,
1715
+ details::proxy_typeid_reflector>>, C>;
1716
+ using support_direct_rtti = basic_facade_builder<
1717
+ details::add_conv_t <Cs, details::conv_impl<true ,
1718
+ details::proxy_cast_dispatch, void (details::proxy_cast_context) &,
1719
+ void (details::proxy_cast_context) const &,
1720
+ void(details::proxy_cast_context) &&>>,
1721
+ details::add_tuple_t<Rs, details::refl_impl<true,
1722
+ details::proxy_typeid_reflector>>, C>;
1721
1723
using support_rtti = support_indirect_rtti;
1722
1724
#endif // __cpp_rtti
1723
1725
template <class F >
@@ -1783,17 +1785,17 @@ struct operator_dispatch;
1783
1785
#define ___PRO_LHS_BINARY_OP_DISPATCH_BODY_IMPL (...) \
1784
1786
template <class T , class Arg > \
1785
1787
decltype (auto ) operator()(T&& self, Arg&& arg) \
1786
- ___PRO_DIRECT_FUNC_IMPL(std::forward<T>(self) __VA_ARGS__ \
1787
- std::forward<Arg>(arg))
1788
+ ___PRO_DIRECT_FUNC_IMPL( \
1789
+ std::forward<T>(self) __VA_ARGS__ std::forward< Arg>(arg))
1788
1790
#define ___PRO_LHS_ALL_OP_DISPATCH_BODY_IMPL (...) \
1789
1791
___PRO_LHS_LEFT_OP_DISPATCH_BODY_IMPL (__VA_ARGS__) \
1790
1792
___PRO_LHS_BINARY_OP_DISPATCH_BODY_IMPL(__VA_ARGS__)
1791
1793
#define ___PRO_LHS_OP_DISPATCH_IMPL (TYPE, ...) \
1792
1794
template <> \
1793
1795
struct operator_dispatch <#__VA_ARGS__, false > { \
1794
1796
___PRO_LHS_##TYPE##_OP_DISPATCH_BODY_IMPL(__VA_ARGS__) \
1795
- ___PRO_DEF_MEM_ACCESSOR_TEMPLATE (___PRO_DEF_LHS_##TYPE##_OP_ACCESSOR, \
1796
- operator __VA_ARGS__) \
1797
+ ___PRO_DEF_MEM_ACCESSOR_TEMPLATE ( \
1798
+ ___PRO_DEF_LHS_##TYPE##_OP_ACCESSOR, operator __VA_ARGS__) \
1797
1799
};
1798
1800
1799
1801
#define ___PRO_DEF_RHS_OP_ACCESSOR (Q, NE, SELF_ARG, SELF, ...) \
@@ -1817,10 +1819,10 @@ ___PRO_DEBUG( \
1817
1819
struct operator_dispatch <#__VA_ARGS__, true > { \
1818
1820
template <class T , class Arg > \
1819
1821
decltype (auto ) operator ()(T&& self, Arg&& arg) \
1820
- ___PRO_DIRECT_FUNC_IMPL (std::forward<Arg>(arg) __VA_ARGS__ \
1821
- std::forward<T>(self)) \
1822
- ___PRO_DEF_FREE_ACCESSOR_TEMPLATE (___PRO_DEF_RHS_OP_ACCESSOR, \
1823
- __VA_ARGS__) \
1822
+ ___PRO_DIRECT_FUNC_IMPL ( \
1823
+ std::forward<Arg>(arg) __VA_ARGS__ std::forward< T>(self)) \
1824
+ ___PRO_DEF_FREE_ACCESSOR_TEMPLATE ( \
1825
+ ___PRO_DEF_RHS_OP_ACCESSOR, __VA_ARGS__) \
1824
1826
};
1825
1827
1826
1828
#define ___PRO_EXTENDED_BINARY_OP_DISPATCH_IMPL (...) \
@@ -1873,8 +1875,8 @@ ___PRO_DEBUG( \
1873
1875
struct operator_dispatch <#__VA_ARGS__, true > { \
1874
1876
template <class T , class Arg > \
1875
1877
decltype (auto ) operator ()(T&& self, Arg&& arg) \
1876
- ___PRO_DIRECT_FUNC_IMPL (std::forward<Arg>(arg) __VA_ARGS__ \
1877
- std::forward<T>(self)) \
1878
+ ___PRO_DIRECT_FUNC_IMPL ( \
1879
+ std::forward<Arg>(arg) __VA_ARGS__ std::forward< T>(self)) \
1878
1880
___PRO_DEF_FREE_ACCESSOR_TEMPLATE (___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR, \
1879
1881
__VA_ARGS__) \
1880
1882
};
@@ -1960,8 +1962,7 @@ struct implicit_conversion_dispatch
1960
1962
template <class T >
1961
1963
T&& operator ()(T&& self) noexcept { return std::forward<T>(self); }
1962
1964
};
1963
- struct explicit_conversion_dispatch
1964
- : details::cast_dispatch_base<true , false > {
1965
+ struct explicit_conversion_dispatch : details::cast_dispatch_base<true , false > {
1965
1966
template <class T >
1966
1967
auto operator ()(T&& self) noexcept
1967
1968
{ return details::explicit_conversion_adapter<T>{std::forward<T>(self)}; }
0 commit comments