sandbox
Loading...
Searching...
No Matches
concepts.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_MEMORY_CONCEPTS_HPP_
3#define LIBSBX_MEMORY_CONCEPTS_HPP_
4
5#include <memory>
6#include <type_traits>
7
8namespace sbx::memory {
9
10template<typename Allocator, typename Type>
11concept allocator_for = std::is_same_v<typename std::allocator_traits<Allocator>::value_type, Type>;
12
13template<typename Allocator, typename Type>
15 using type = typename std::allocator_traits<Allocator>::rebind_alloc<Type>;
16};
17
18template<typename Allocator, typename Type>
19using rebound_allocator_t = rebound_allocator<Allocator, Type>::type;
20
21} // namespace sbx::memory
22
23#endif // LIBSBX_MEMORY_CONCEPTS_HPP_
Definition: concepts.hpp:14