|
Boost : |
From: Anthony Williams (anthwil_at_[hidden])
Date: 2002-10-01 03:37:47
Toon Knapen writes:
> I've been using my own std::is_sorted, std::iota etc. on compilers/stl's that
> do not provide these extensions (snippet below). OTOH, I've seen that
> boost/detail/algorithm does the same thing (but here all these are defined in
> the boost namespace, not the std namespace).
>
> Now I think it would be interesting to provide these extensions for all stl's
> that do not include these to improve portabilitity of C++ programs. Should
> boost/detail/algorithm.hpp be used for this (but in that case the header
> should directly be in the boost includes and not in a 'detail' subdirectory)
> or would it be better to define these in the std namespace ?
It is undefined behaviour to add them to namespace std, so they had better
live in namespace boost.
However, they look useful so should be in a non-detail header. For those
implementations that have them, boost::x could forward to std::x
Anthony
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk