Header file range/v3/view/replace.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

#include <range/v3/view/transform.hpp>

#include <range/v3/utility/concepts.hpp>

#include <range/v3/utility/functional.hpp>

#include <range/v3/utility/static_const.hpp>

#include <range/v3/view/view.hpp>

#include <range/v3/view/all.hpp>

namespace ranges
{
    inline namespace v3
    {
        namespace detail
        {
            template <typename Val1, typename Val2>
            struct replacer_fn
            {
                replacer_fn() = default;
                
                replacer_fn(Val1 old_value, Val2 new_value);
                
                template <typename I>
                common_type_t<decay_t<unwrap_reference_t<Val2 const&>>, iterator_value_t<I>>& operator()(copy_tag, I const& i) const;
                
                template <typename I>
                common_reference_t<unwrap_reference_t<Val2 const&>, iterator_reference_t<I>> operator()(I const& i) const;
                
                template <typename I>
                common_reference_t<unwrap_reference_t<Val2 const&>, iterator_rvalue_reference_t<I>> operator()(move_tag, I const& i) const;
            };
        }
        
        namespace view
        {
            struct replace_fn
            {
                template <typename Rng, typename Val1, typename Val2, typename V1 = detail::decay_t<unwrap_reference_t<Val1>>, typename V2 = detail::decay_t<unwrap_reference_t<Val2>>>
                using Concept = meta::and_<InputRange<Rng>, Same<V1, V2>, EqualityComparable<V1, range_value_t<Rng>>, Common<detail::decay_t<unwrap_reference_t<Val2 const&>>, range_value_t<Rng>>, CommonReference<unwrap_reference_t<Val2 const&>, range_reference_t<Rng>>, CommonReference<unwrap_reference_t<Val2 const&>, range_rvalue_reference_t<Rng>>>;
                
                template <typename Rng, typename Val1, typename Val2, int _concept_requires_121 = 42, typename std::enable_if<(_concept_requires_121==43)||(Concept<Rng, Val1, Val2>()), int>::type=0>
                replace_view<all_t<Rng>, detail::decay_t<Val1>, detail::decay_t<Val2>> operator()(Rng&& rng, Val1&& old_value, Val2&& new_value) const;
                
                template <typename Rng, typename Val1, typename Val2, int _concept_requires_132 = 42, typename std::enable_if<(_concept_requires_132==43)||(!Concept<Rng, Val1, Val2>()), int>::type=0>
                void operator()(Rng&&, Val1&&, Val2&&) const;
            };
            
            inline namespace 
            {
                constexpr auto& replace = static_const<view<replace_fn>>::value;
            }
        }
    }
}