Boost.Algorithms organization question

So, while I'm waiting for my review result, I've been implementing the new algorithms that were to the standard library for C++11 (at least the ones that don't require the new language features) They are: all_of any_of none_of find_if_not copy_if copy_n is_partitioned partition_point is_sorted is_sorted_until minmax -- this one is already in boost minmax_element -- this one is already in boost, but doesn't satisfy the C++11 performance gaurantees iota (and, of course, Boost.Range versions wherever appropriate) I have not done: shuffle -- requires rvalue references random_shuffle -- requires rvalue references move -- already in Boost.Move; maybe just a forwarding header file? move_backward -- already in Boost.Move; maybe just a forwarding header file? Anyway - my question is: Should these all go into a "c++11" subdirectory? If so, should I create a "c++11.hpp" header file that includes all of them, so that users can just #include <boost/algorithm/C++11.hpp> and get all the C++11 algorithms? Alternately, should they just live in boost/algorithm ? -- Marshall

Marshall Clow-2 wrote
So, while I'm waiting for my review result, I've been implementing the new algorithms that were to the standard library for C++11 (at least the ones that don't require the new language features)
(and, of course, Boost.Range versions wherever appropriate)
IMO, the Boost.Range versions shouldn't go into the c++11 file.
I have not done: shuffle -- requires rvalue references random_shuffle -- requires rvalue references
Could a Boost.Move emulation help here?
move -- already in Boost.Move; maybe just a forwarding header file? move_backward -- already in Boost.Move; maybe just a forwarding header file?
Anyway - my question is: Should these all go into a "c++11" subdirectory? If so, should I create a "c++11.hpp" header file that includes all of them, so that users can just #include <boost/algorithm/C++11.hpp> and get all the C++11 algorithms?
Alternately, should they just live in boost/algorithm ?
I would create a std_2011.hpp file. In addition if this is not too much work I will find very useful to have a kind of C++11 standard that uses std instead of boost as it was done for TR1; boost/std_2011/algorithm We could do this way for all the standard files for which Boost provides a c++11 compliant implementation or a c++03 emulation. Best, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/Boost-Algorithms-organization-question-tp... Sent from the Boost - Dev mailing list archive at Nabble.com.

Vicente Botet wrote:
Marshall Clow-2 wrote
So, while I'm waiting for my review result, I've been implementing the new algorithms that were to the standard library for C++11 (at least the ones that don't require the new language features)
Great!
(and, of course, Boost.Range versions wherever appropriate)
Very nice.
IMO, the Boost.Range versions shouldn't go into the c++11 file.
Right.
Should these all go into a "c++11" subdirectory? If so, should I create a "c++11.hpp" header file that includes all of them, so that users can just #include <boost/algorithm/C++11.hpp> and get all the C++11 algorithms?
The special characters in the filename could be an issue, even today, couldn't they?
Alternately, should they just live in boost/algorithm ?
I would create a std_2011.hpp file.
I didn't see value in this idea at first, but if the following idea is used, then it makes sense.
In addition if this is not too much work I will find very useful to have a kind of C++11 standard that uses std instead of boost as it was done for TR1;
boost/std_2011/algorithm
We could do this way for all the standard files for which Boost provides a c++11 compliant implementation or a c++03 emulation.
Whether the directory is std_2011 or c++11 or C++11 doesn't matter too much, other than portability. However, using namespace std is handy, but it might cause ODR issues for platforms that provide the algorithms. Without providing everything from C++11, that header would be a lie. That is, if you provide a file named algorithm in such a directory, it should contain everything from the standard, shouldn't it? Otherwise, we'd use namespace boost and expect less certain coverage. Even if you go that route, I'd think there should be versions available in namespace boost that support ranges. _____ Rob Stewart robert.stewart@sig.com Software Engineer using std::disclaimer; Dev Tools & Components Susquehanna International Group, LLP http://www.sig.com ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

On Dec 14, 2011, at 10:20 AM, Stewart, Robert wrote:
Without providing everything from C++11, that header would be a lie. That is, if you provide a file named algorithm in such a directory, it should contain everything from the standard, shouldn't it? Otherwise, we'd use namespace boost and expect less certain coverage.
There are some things in the C++11 library that require new language features (such as rvalue-references) I don't see any way to implement them identically using only C++03. -- Marshall Marshall Clow Idio Software <mailto:mclow.lists@gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki

On Dec 5, 2011, at 7:56 AM, Marshall Clow wrote:
So, while I'm waiting for my review result, I've been implementing the new algorithms that were to the standard library for C++11 (at least the ones that don't require the new language features)
They are: all_of any_of none_of find_if_not copy_if copy_n is_partitioned partition_point is_sorted is_sorted_until minmax -- this one is already in boost minmax_element -- this one is already in boost, but doesn't satisfy the C++11 performance gaurantees iota (and, of course, Boost.Range versions wherever appropriate)
I have not done: shuffle -- requires rvalue references random_shuffle -- requires rvalue references move -- already in Boost.Move; maybe just a forwarding header file? move_backward -- already in Boost.Move; maybe just a forwarding header file?
Anyway - my question is: Should these all go into a "c++11" subdirectory? If so, should I create a "c++11.hpp" header file that includes all of them, so that users can just #include <boost/algorithm/C++11.hpp> and get all the C++11 algorithms?
Alternately, should they just live in boost/algorithm ?
So - just to make this all concrete, I've pushed my work to http://github.com/mclow/Boost.Algorithm -- Marshall Marshall Clow Idio Software <mailto:mclow.lists@gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
participants (3)
-
Marshall Clow
-
Stewart, Robert
-
Vicente Botet