Boost logo

Boost :

Subject: Re: [boost] Should I use std::get or boost::get (or both) in Boost.Array
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-12-18 16:27:17


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).

-- Jeremiah Willcock


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