Skip to content

Commit def893c

Browse files
committed
Fix compiler error - cannot use concept inline with auto
1 parent cbd2cd2 commit def893c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/cpp2util.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,8 @@ constexpr auto is( X const& x ) -> auto
20502050
}
20512051

20522052

2053-
inline constexpr auto is( specialization_of_template<std::variant> auto const& x, auto&& value ) -> bool
2053+
template <specialization_of_template<std::variant> X>
2054+
inline constexpr auto is( X const& x, auto&& value ) -> bool
20542055
{
20552056
return type_find_if(x, [&]<typename It>(It const&) -> bool {
20562057
if (x.index() == It::index) {
@@ -2064,8 +2065,8 @@ inline constexpr auto is( specialization_of_template<std::variant> auto const& x
20642065
}) != std::variant_npos;
20652066
}
20662067

2067-
template< typename C >
2068-
auto as(specialization_of_template<std::variant> auto&& x CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAULT_AS) -> decltype(auto)
2068+
template< typename C, specialization_of_template<std::variant> X >
2069+
auto as(X&& x CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAULT_AS) -> decltype(auto)
20692070
{
20702071
constness_like_t<C, decltype(x)>* ptr = nullptr;
20712072
type_find_if(CPP2_FORWARD(x), [&]<typename It>(It const&) -> bool {

0 commit comments

Comments
 (0)