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