Skip to content

Commit

Permalink
Revert "pass by const ref in 'apply_const'"
Browse files Browse the repository at this point in the history
This reverts commit a3014f5.
  • Loading branch information
artemp committed Apr 1, 2015
1 parent a3014f5 commit e031c53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ template<typename F, typename V, typename R>
struct dispatcher<F, V, R>
{
using result_type = R;
VARIANT_INLINE static result_type apply_const(V const&, F const&)
VARIANT_INLINE static result_type apply_const(V const&, F const& f)
{
throw std::runtime_error(std::string("unary dispatch: FAIL ") + typeid(V).name());
}

VARIANT_INLINE static result_type apply(V &, F &)
VARIANT_INLINE static result_type apply(V &, F & f)
{
throw std::runtime_error(std::string("unary dispatch: FAIL ") + typeid(V).name());
}
Expand Down Expand Up @@ -716,7 +716,7 @@ class variant
// unary
template <typename F, typename V>
auto VARIANT_INLINE
static visit(V const& v, F const& f)
static visit(V const& v, F & f)
-> decltype(detail::dispatcher<F, V,
typename detail::result_of_unary_visit<F,
typename detail::select_type<0, Types...>::type>::type, Types...>::apply_const(v, f))
Expand All @@ -740,7 +740,7 @@ class variant
// const
template <typename F, typename V>
auto VARIANT_INLINE
static binary_visit(V const& v0, V const& v1, F const& f)
static binary_visit(V const& v0, V const& v1, F & f)
-> decltype(detail::binary_dispatcher<F, V,
typename detail::result_of_binary_visit<F,
typename detail::select_type<0, Types...>::type>::type, Types...>::apply_const(v0, v1, f))
Expand All @@ -751,7 +751,7 @@ class variant
// non-const
template <typename F, typename V>
auto VARIANT_INLINE
static binary_visit(V& v0, V& v1, F const& f)
static binary_visit(V& v0, V& v1, F & f)
-> decltype(detail::binary_dispatcher<F, V,
typename detail::result_of_binary_visit<F,
typename detail::select_type<0, Types...>::type>::type, Types...>::apply(v0, v1, f))
Expand Down

0 comments on commit e031c53

Please sign in to comment.