avoided void& in non_std_allocator<void>

This commit is contained in:
joaquintides
2018-01-03 21:34:46 +01:00
parent 36b17f6de6
commit 350d337348
2 changed files with 27 additions and 2 deletions
+2 -1
View File
@@ -70,6 +70,7 @@ Acknowledgements
<li>Avoided usage of <code>std::allocator</code> members deprecated in C++17.
Contributed by Daniela Engert.
</li>
<li>Maintenance fixes.</li>
</ul>
</p>
@@ -571,7 +572,7 @@ Acknowledgements
<br>
<p>Revised January 1st 2018</p>
<p>Revised January 3rd 2018</p>
<p>&copy; Copyright 2003-2018 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
+25 -1
View File
@@ -1,6 +1,6 @@
/* Used in Boost.MultiIndex tests.
*
* Copyright 2003-2015 Joaquin M Lopez Munoz.
* Copyright 2003-2018 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -134,4 +134,28 @@ public:
}
};
template<>
class non_std_allocator<void>
{
public:
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template<class U>struct rebind{typedef non_std_allocator<U> other;};
non_std_allocator(){}
non_std_allocator(const non_std_allocator<void>&){}
template<class U>non_std_allocator(const non_std_allocator<U>&,int=0){}
friend bool operator==(const non_std_allocator&,const non_std_allocator&)
{
return true;
}
friend bool operator!=(const non_std_allocator&,const non_std_allocator&)
{
return false;
}
};
#endif