Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-01-24 16:10:34


On Wed, 24 Jan 2001, Jens Maurer wrote:
Jens.M> > 2. As an alternative, should Boost libraries use Koenig lookup
Jens.M>
Jens.M> Yes.
Jens.M>
Jens.M> As a workaround for compilers without Koenig lookup, the relevant
Jens.M> functions can be duplicated in namespace boost with appropriate
Jens.M> inline overloads which delegate to std::. Of course, you have to
Jens.M> prevent multiple definition, which means you need a separate header
Jens.M> file for that. See my suggestion in the thread
Jens.M> "Big checkin, lots of fixes".

But what about other people's libraries (that are not inside namesapce
boost)? Will they also have to duplicate the functions in their own
namespace? If so, it seems like we ought to create a header so
that people can do this:

namespace my_stuff {
  #include <boost/import_std_functions.hpp>
  ...
}

In my opinion, this is an aweful lot of work just to obey the
letter of the law. I still vote for ignoring the prohibition on
defining functions in namespace std (for overloaded functions).

Also, what about std::swap? You can't use Koenig lookup on that function
anyways, because there's a fully templated version of it in namespace std
that you can't get to using Koenig lookup.

Ciao,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk