mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Protect dereferenceable<> against overloaded operator&, fixes #35
This commit is contained in:
parent
a6c175e2c3
commit
ad0fc7c9d3
@ -9,6 +9,7 @@
|
|||||||
// See http://www.boost.org/libs/utility/operators.htm for documentation.
|
// See http://www.boost.org/libs/utility/operators.htm for documentation.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
|
// 23 Nov 17 Protect dereferenceable<> from overloaded operator&.
|
||||||
// 15 Oct 17 Adapted to C++17, replace std::iterator<> with manual
|
// 15 Oct 17 Adapted to C++17, replace std::iterator<> with manual
|
||||||
// implementation.
|
// implementation.
|
||||||
// 22 Feb 16 Added ADL protection, preserve old work-arounds in
|
// 22 Feb 16 Added ADL protection, preserve old work-arounds in
|
||||||
@ -98,6 +99,7 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
#include <boost/core/addressof.hpp>
|
||||||
|
|
||||||
#if defined(__sgi) && !defined(__GNUC__)
|
#if defined(__sgi) && !defined(__GNUC__)
|
||||||
# pragma set woff 1234
|
# pragma set woff 1234
|
||||||
@ -302,7 +304,7 @@ struct dereferenceable : B
|
|||||||
{
|
{
|
||||||
P operator->() const
|
P operator->() const
|
||||||
{
|
{
|
||||||
return &*static_cast<const T&>(*this);
|
return ::boost::addressof(*static_cast<const T&>(*this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1667,8 +1667,8 @@ T operator+( T lhs, const T& rhs )
|
|||||||
|
|
||||||
<td><code>P operator->() const</code></td>
|
<td><code>P operator->() const</code></td>
|
||||||
|
|
||||||
<td><code>(&*i)</code>. Return convertible to
|
<td><code>*i</code>. Address of the returned value convertible
|
||||||
<code>P</code>.</td>
|
to <code>P</code>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user