mirror of
https://github.com/boostorg/core.git
synced 2025-11-29 13:50:10 +01:00
Moved checked deleters into internal namespace to block unintended ADL.
This prevents adding namespace boost to ADL when the deleters are used in template parameters, e.g. in std::unique_ptr.
This commit is contained in:
@@ -60,6 +60,10 @@ template<class T> inline void checked_array_delete(T * x) BOOST_NOEXCEPT
|
||||
delete [] x;
|
||||
}
|
||||
|
||||
// Block unintended ADL
|
||||
namespace checked_deleters
|
||||
{
|
||||
|
||||
template<class T> struct checked_deleter
|
||||
{
|
||||
typedef void result_type;
|
||||
@@ -83,6 +87,11 @@ template<class T> struct checked_array_deleter
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace checked_deleters
|
||||
|
||||
using checked_deleters::checked_deleter;
|
||||
using checked_deleters::checked_array_deleter;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_CHECKED_DELETE_HPP
|
||||
|
||||
Reference in New Issue
Block a user