First
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "tl/detail/prologue.h"
|
||||
#include "tl/iterator.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace tl
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// count()
|
||||
//
|
||||
// Container-based version of the <algorithm> `std::count()` function to
|
||||
// count values that match within a container
|
||||
template <typename C, typename T>
|
||||
auto count(const C& c, T&& value) noexcept -> typename std::iterator_traits<typename C::iterator>::difference_type;
|
||||
|
||||
// count_if()
|
||||
//
|
||||
// Container-based version of the <algorithm> `std::count()` function to
|
||||
// count values that match within a container
|
||||
template <typename C, typename UnaryPredicate>
|
||||
auto count_if(const C& c, UnaryPredicate&& p) noexcept -> typename std::iterator_traits<typename C::iterator>::difference_type;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
} // end namespace tl
|
||||
|
||||
Reference in New Issue
Block a user