--- any.hpp 2016-11-21 14:50:49.000000000 +0530 +++ any_patched.hpp 2016-11-21 14:49:58.000000000 +0530 @@ -15,6 +15,7 @@ // when: July 2001, April 2013 - May 2013 #include +#include #include "boost/config.hpp" #include @@ -244,7 +245,7 @@ ValueType * any_cast(any * operand) BOOST_NOEXCEPT { return operand && operand->type() == boost::typeindex::type_id() - ? &static_cast::type> *>(operand->content)->held + ? std::addressof(static_cast::type> *>(operand->content)->held) : 0; } @@ -260,7 +261,7 @@ typedef BOOST_DEDUCED_TYPENAME remove_reference::type nonref; - nonref * result = any_cast(&operand); + nonref * result = any_cast(std::addressof(operand)); if(!result) boost::throw_exception(bad_any_cast()); @@ -306,7 +307,7 @@ template inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT { - return &static_cast *>(operand->content)->held; + return std::addressof(static_cast *>(operand->content)->held); } template