Sequoia
Loading...
Searching...
No Matches
AllocationCheckersTraits.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2020. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
15
16namespace sequoia::testing
17{
18 template <class A>
19 concept counting_alloc = alloc<A> && requires(const std::remove_reference_t<A>& a) {
20 a.allocs();
21 };
22
23 template<class Fn, class T>
24 concept alloc_getter = requires(Fn fn, const std::remove_reference_t<T>& t) {
25 { fn(t) } -> counting_alloc;
26 };
27}
Concepts which are sufficiently general to appear in the sequoia namespace.
A concept for allocators.
Definition: Concepts.hpp:48
Definition: AllocationCheckersTraits.hpp:24
Definition: AllocationCheckersTraits.hpp:19