mirror of
https://github.com/boostorg/core.git
synced 2025-11-28 21:30:09 +01:00
Move fclose_deleter and null_deleter to their own namespaces to block ADL.
This prevents bringing namespace boost into ADL when the deleters are used in template parameters, e.g. in std::unique_ptr.
This commit is contained in:
@@ -11,6 +11,15 @@
|
||||
|
||||
* Added a new [link core.functor `boost/core/functor.hpp`] header with a `functor` class template
|
||||
for wrapping a raw function into a function object class.
|
||||
* Changed [link core.null_deleter `null_deleter`] and [link core.fclose_deleter `fclose_deleter`]
|
||||
definitions so that they don't bring namespace `boost` into argument-dependent lookup in cases
|
||||
like this:
|
||||
```
|
||||
std::unique_ptr< std::FILE, boost::fclose_deleter > p1, p2;
|
||||
swap(p1, p2); // no longer looks for boost::swap as part of ADL
|
||||
```
|
||||
Users may need to either explicitly qualify the namespace of the called function or add a
|
||||
`using`-declaration.
|
||||
|
||||
[endsect]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user