2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2014-01-08 07:48:12 +00:00
|
|
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
2013-08-08 09:54:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
2013-02-26 01:43:27 +00:00
|
|
|
#ifndef SPROUT_CONTAINER_CONTAINER_FITNESS_TRAITS_HPP
|
|
|
|
#define SPROUT_CONTAINER_CONTAINER_FITNESS_TRAITS_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
2014-07-12 03:59:16 +00:00
|
|
|
#include <sprout/container/traits_fwd.hpp>
|
2013-02-26 01:43:27 +00:00
|
|
|
#include <sprout/container/container_traits.hpp>
|
|
|
|
#include <sprout/container/size.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// container_fitness_traits
|
|
|
|
//
|
|
|
|
template<typename Container>
|
|
|
|
struct container_fitness_traits {
|
|
|
|
public:
|
|
|
|
template<typename Cont>
|
|
|
|
static SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
2014-07-12 03:59:16 +00:00
|
|
|
fit_size(Cont&& cont, typename sprout::container_traits<Container>::size_type size) {
|
2014-02-22 07:32:51 +00:00
|
|
|
return NS_SSCRISK_CEL_OR_SPROUT::min(size, sprout::size(SPROUT_FORWARD(Cont, cont)));
|
2013-02-26 01:43:27 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
template<typename Container>
|
|
|
|
struct container_fitness_traits<Container const>
|
|
|
|
: public sprout::container_fitness_traits<Container>
|
|
|
|
{};
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_CONTAINER_CONTAINER_FITNESS_TRAITS_HPP
|