This commit is contained in:
jeanlemotan
2024-07-02 18:06:33 +02:00
commit 8297b0b45f
157 changed files with 24865 additions and 0 deletions
+30
View File
@@ -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