custom allocators: define missing 'rebind' type (#3895)

This commit is contained in:
Sergei Trofimovich
2023-03-08 11:31:56 +00:00
committed by GitHub
parent b504dca35a
commit 6cec5aefc9
2 changed files with 18 additions and 0 deletions

View File

@@ -189,6 +189,15 @@ class my_allocator : public std::allocator<T>
{
public:
using std::allocator<T>::allocator;
my_allocator() = default;
template<class U> my_allocator(const my_allocator<U>& /*unused*/) { }
template <class U>
struct rebind
{
using other = my_allocator<U>;
};
};
/////////////////////////////////////////////////////////////////////