#ifndef SPROUT_ALGORITHM_OUTFIT_REPLACE_HPP #define SPROUT_ALGORITHM_OUTFIT_REPLACE_HPP #include #include #include #include #include namespace sprout { namespace outfit { namespace detail { template SPROUT_CONSTEXPR inline sprout::sub_array::fixed_container_type> replace_impl( Container const& cont, T const& old_value, T const& new_value, typename sprout::fixed_container_traits::difference_type offset ) { return sprout::sub_copy( sprout::fixed::replace(cont, old_value, new_value), offset, offset + sprout::size(cont) ); } } // namespace detail // // replace // template SPROUT_CONSTEXPR inline sprout::sub_array::fixed_container_type> replace( Container const& cont, T const& old_value, T const& new_value ) { return sprout::outfit::detail::replace_impl(cont, old_value, new_value, sprout::fixed_begin_offset(cont)); } } // namespace outfit } // namespace sprout #endif // #ifndef SPROUT_ALGORITHM_OUTFIT_REPLACE_HPP