2012-03-31 07:24:13 +00:00
|
|
|
#ifndef SPROUT_CONTAINER_SIZE_HPP
|
|
|
|
#define SPROUT_CONTAINER_SIZE_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/container/container_traits.hpp>
|
|
|
|
#include <sprout/container/begin.hpp>
|
|
|
|
#include <sprout/container/end.hpp>
|
2013-01-03 08:01:50 +00:00
|
|
|
#include <sprout/iterator/operation.hpp>
|
2012-03-31 07:24:13 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// size
|
|
|
|
//
|
|
|
|
template<typename Container>
|
2012-05-21 16:06:13 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
|
|
|
size(Container const& cont) {
|
2013-01-03 08:01:50 +00:00
|
|
|
return sprout::distance(sprout::begin(cont), sprout::end(cont));
|
2012-03-31 07:24:13 +00:00
|
|
|
}
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_CONTAINER_SIZE_HPP
|