Opened 6 years ago
Last modified 6 years ago
#12158 assigned Feature Requests
boost::size() and friends should use an ADL barrier like boost::begin
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.60.0 | Severity: | Problem |
Keywords: | Cc: |
Description
boost::begin() and boost::end() are nicely declared in an ADL barrier namespace to avoid conflicts with code like this:
using std::begin; auto i = begin(c);
N4280 has been accepted into C++17, which adds std::size, std::empty, and std::data. But if users attempt to use those in the same way:
using std::size; auto s = size(c);
They may get an error. For example, if c is a std::vector<boost::shared_ptr<int>> or something, boost::size() will be found by ADL, and since it's no more specific than std::size, the call will be ambiguous.
Note:
See TracTickets
for help on using tickets.