gcc-13 rebind compile failure fix. Adding struct rebind for custom allocators as per this thread https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72792#c7

This commit is contained in:
Navin P 2023-03-06 11:15:27 +05:30
parent b504dca35a
commit 0ae7624c14
2 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,11 @@ struct bad_allocator : std::allocator<T>
{
using std::allocator<T>::allocator;
template<typename U>
struct rebind {
using other = bad_allocator<U>;
};
template<class... Args>
void construct(T* /*unused*/, Args&& ... /*unused*/)
{

View File

@ -187,6 +187,11 @@ std::string* sax_no_exception::error_string = nullptr;
template<class T>
class my_allocator : public std::allocator<T>
{
template<typename U>
struct rebind {
using other = my_allocator<U>;
};
public:
using std::allocator<T>::allocator;
};