diff --git a/xyz/detail/protocol_wrappers.hh b/xyz/detail/protocol_wrappers.hh index 0ccb198..c7c78b6 100644 --- a/xyz/detail/protocol_wrappers.hh +++ b/xyz/detail/protocol_wrappers.hh @@ -42,9 +42,9 @@ enum class const_policy { propagate, // `protocol_view`: every wrapper is const-qualified regardless of `I` // (shallow const, as for `std::span`). - all_const, + constify, // `protocol_view`: only the const member functions of `I`. - const_only, + only_const, }; // Returns `true` if `member` if forwarded under `ConstPolicy`. @@ -56,11 +56,11 @@ consteval bool is_forwarded_member_function( // `protocol` propagates const through forwarded member function calls // so supports const and non-const qualified member functions. return true; - case const_policy::const_only: + case const_policy::only_const: // `protocol_view` forwards only const-qualified member // functions. return is_const(member); - case const_policy::all_const: + case const_policy::constify: // `protocol_view` is a view type: overload resolution through // a const and non-const access path must yield the same result. // A const-qualified member function is only given a forwarding wrapper if @@ -88,8 +88,8 @@ consteval void reject_conversion_functions_of_mixed_constness( std::meta::info first = {}; for (std::meta::info member : members) { if (!is_conversion_function(member) || - !is_forwarded_member_function(member, - members)) { + !is_forwarded_member_function(member, + members)) { continue; } if (first == std::meta::info{}) { @@ -156,7 +156,7 @@ template members = protocol_interface_functions_of; - if (ConstPolicy == const_policy::all_const) { + if (ConstPolicy == const_policy::constify) { reject_conversion_functions_of_mixed_constness(members); } std::vector member_base_types; diff --git a/xyz/protocol.hh b/xyz/protocol.hh index 86e9b76..0dac1e7 100644 --- a/xyz/protocol.hh +++ b/xyz/protocol.hh @@ -557,7 +557,7 @@ template class protocol_view : public detail::protocol_wrappers_t, detail::vtable_t, - detail::const_policy::all_const> { + detail::const_policy::constify> { public: // The default constructor is deleted as a default constructed // `protocol_view` would be empty. @@ -669,7 +669,7 @@ template class protocol_view : public detail::protocol_wrappers_t, detail::vtable_t, - detail::const_policy::const_only> { + detail::const_policy::only_const> { public: // The default constructor is deleted as a default constructed // `protocol_view` would be empty. diff --git a/xyz/tests/protocol_operator_tests.cc b/xyz/tests/protocol_operator_tests.cc index 0d256dd..68161d3 100644 --- a/xyz/tests/protocol_operator_tests.cc +++ b/xyz/tests/protocol_operator_tests.cc @@ -590,7 +590,7 @@ consteval bool view_wrappers_reject() { try { (void)xyz::detail::generate_member_bases_wrapper< ^^Interface, protocol_view, xyz::detail::vtable_t, - xyz::detail::const_policy::all_const>(); + xyz::detail::const_policy::constify>(); } catch (const std::runtime_error&) { return true; }