Opened 3 years ago

#12111 new Bugs

use std placeholders in boost::bind in c++11

Reported by: anonymous Owned by: Peter Dimov
Milestone: To Be Determined Component: bind
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:


Currently boost::bind imports its placeholders into the global namespace. Note that this can also happen if you do not just use boost bind at all, since multiple other boost libraries like boost::thread, boost::iostreams or boost::multi_index also include boost/bind.hpp in some way.

This clashes with std placeholders if people want to use them like they did previously with boost placeholders (in global namespace). Because _1 .. _N are now aliases to both the boost placeholders and the std placeholders.

To me it seems like the best way to fix this is to make boost bind use std placeholders when used with c++11 so that the boost::bind::placeholders namespace just becomes and alias for std::placeholders

Change History (0)

Note: See TracTickets for help on using tickets.