Skip to content

Commit e031c53

Browse files
committed
Revert "pass by const ref in 'apply_const'"
This reverts commit a3014f5.
1 parent a3014f5 commit e031c53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

variant.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ template<typename F, typename V, typename R>
297297
struct dispatcher<F, V, R>
298298
{
299299
using result_type = R;
300-
VARIANT_INLINE static result_type apply_const(V const&, F const&)
300+
VARIANT_INLINE static result_type apply_const(V const&, F const& f)
301301
{
302302
throw std::runtime_error(std::string("unary dispatch: FAIL ") + typeid(V).name());
303303
}
304304

305-
VARIANT_INLINE static result_type apply(V &, F &)
305+
VARIANT_INLINE static result_type apply(V &, F & f)
306306
{
307307
throw std::runtime_error(std::string("unary dispatch: FAIL ") + typeid(V).name());
308308
}
@@ -716,7 +716,7 @@ class variant
716716
// unary
717717
template <typename F, typename V>
718718
auto VARIANT_INLINE
719-
static visit(V const& v, F const& f)
719+
static visit(V const& v, F & f)
720720
-> decltype(detail::dispatcher<F, V,
721721
typename detail::result_of_unary_visit<F,
722722
typename detail::select_type<0, Types...>::type>::type, Types...>::apply_const(v, f))
@@ -740,7 +740,7 @@ class variant
740740
// const
741741
template <typename F, typename V>
742742
auto VARIANT_INLINE
743-
static binary_visit(V const& v0, V const& v1, F const& f)
743+
static binary_visit(V const& v0, V const& v1, F & f)
744744
-> decltype(detail::binary_dispatcher<F, V,
745745
typename detail::result_of_binary_visit<F,
746746
typename detail::select_type<0, Types...>::type>::type, Types...>::apply_const(v0, v1, f))
@@ -751,7 +751,7 @@ class variant
751751
// non-const
752752
template <typename F, typename V>
753753
auto VARIANT_INLINE
754-
static binary_visit(V& v0, V& v1, F const& f)
754+
static binary_visit(V& v0, V& v1, F & f)
755755
-> decltype(detail::binary_dispatcher<F, V,
756756
typename detail::result_of_binary_visit<F,
757757
typename detail::select_type<0, Types...>::type>::type, Types...>::apply(v0, v1, f))

0 commit comments

Comments
 (0)