Header file algorithms/replace.hpp

namespace brigand
{
    namespace lazy
    {
        template <template <typename> class S, typename ... Ts, typename Predicate, typename NewType>
        struct replace_if<S<Ts...>, Predicate, NewType>
        {
            using type = S<typename detail::replacer<Ts, Predicate, NewType>::type...>;
        };
        
        template <typename Sequence, typename OldType, typename NewType>
        using replace = replace_if<Sequence, std::is_same<_1, pin<OldType>>, NewType>;
    }
    
    template <typename Sequence, typename Predicate, typename NewType>
    using replace_if = typename::brigand::lazy::replace_if<Sequence, Predicate, NewType>::type;
    
    template <typename Sequence, typename OldType, typename NewType>
    using replace = typename::brigand::lazy::replace<Sequence, OldType, NewType>::type;
}