Boost logo

Boost Users :

Subject: Re: [Boost-users] boost.array query
From: Niels Dekker - address until 2010-10-10 (niels_address_until_2010-10-10_at_[hidden])
Date: 2009-08-06 07:36:59


Sean Farrow wrote:
> I'm using boost.array in a call (waitForMultipleObjects) to be
> specific. I am passing the c_array() (i.e void const *) if I do this
> do I need to use 0 or can I still use 1-based indices for my switch
> statement.Any help appreciated.

Please note that the current version of boost::array::c_array() is
somewhat questionable. It does not return a reference to the internal
C-style array, as one might expect. Herve Martin submitted a ticket on
this issue: Ticket #2857, "change return type of the c_array() member
function", https://svn.boost.org/trac/boost/ticket/2857 The Standard
C++ Library Working Group (LWG) considers adding a similar function to
std::array: LWG issue 930, "Access to std::array data as built-in array
type" www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#930

Anyway, in your case, you might consider using boost::array::data()
instead.

But whatever you do, array indices always start at zero, in C++. Does
that answer your question?

Kind regards, Niels

--
Niels Dekker
http://www.xs4all.nl/~nd/dekkerware
Scientific programmer at LKEB, Leiden University Medical Center 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net