#ifndef SPROUT_ALGORITHM_FIT_SHUFFLE_HPP #define SPROUT_ALGORITHM_FIT_SHUFFLE_HPP #include #include #include #include #include #include #include namespace sprout { namespace fit { namespace detail { template SPROUT_CONSTEXPR inline typename sprout::fit::result_of::algorithm::type shuffle_impl( Container const& cont, UniformRandomNumberGenerator&& g, typename sprout::fixed_container_traits::difference_type offset ) { return sprout::sub_copy( sprout::get_fixed(sprout::fixed::shuffle(cont, sprout::forward(g))), offset, offset + sprout::size(cont) ); } } // namespace detail // // shuffle // template SPROUT_CONSTEXPR inline typename sprout::fit::result_of::algorithm::type shuffle( Container const& cont, UniformRandomNumberGenerator&& g ) { return sprout::fit::detail::shuffle_impl( cont, sprout::forward(g), sprout::fixed_begin_offset(cont) ); } } // namespace fit } // namespace sprout #endif // #ifndef SPROUT_ALGORITHM_FIT_SHUFFLE_HPP