Boost logo

Boost :

Subject: Re: [boost] Should I use std::get or boost::get (or both) in Boost.Array
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2012-12-18 19:55:12


On Dec 18, 2012, at 1:27 PM, Jeremiah Willcock <jewillco_at_[hidden]> wrote:
> On Tue, 18 Dec 2012, Marshall Clow wrote:
>
>> I've got a feature request for Boost.Array to provide compile-time checked access to the members of an array.
>>
>> In C++11, this is done using std::get<Idx> (std::array).
>> Fine, I can specialize this in Boost.Array - well, for C++11.
>> I can't specialize a nonexistent template in namespace std for C++03 (well, I _can_ but the standard says I must not).
>>
>> But Boost.Tuple has a get<> template.
>> I believe I can specialize that for Boost.Array, w/o stepping on Boost.Tuples code.
>>
>> What do people think?
>> boost::get?
>> std::get?
>>
>> Both?
>
> Boost.Graph also has functions named boost::get (without any explicit template parameters needing to be specified); that has caused trouble before. If you avoid conflicting with Boost.Variant's use of boost::get, though, you are likely to avoid Boost.Graph's uses as well. That may not be an issue if you are overloading existing implementations that already work (albeit with tuple types, not arrays), though. Please be sure your changes work in the libs/graph/test/grid_graph_cc.cpp and libs/graph/test/grid_graph_test.cpp tests; boost/graph/grid_graph.hpp already defines functions named boost::get with boost::arrays and pairs of them as parameters (but with other parameter types that do not conflict with yours).

Ok - checked in (with tests).
I will be watching the test results for the next few days, but if you see anything untoward, please let me know.

Thanks!

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


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