Boost logo

Boost Users :

Subject: Re: [Boost-users] tuple memory alignment
From: Ravi (lists_ravi_at_[hidden])
Date: 2009-10-17 18:46:57


On Thursday 15 October 2009 14:53:04 Sebastian Hegler wrote:
> I
> noticed that having a std::vector containing boost::tuple elements has
> "dense" memory layout.

std::vector is guaranteed to layout data as a contiguous array of its
elements, i.e., for a vector v of size k (parantheses added for clarity),
    ( &( v[0] ) )[m]
points to v[m] for m less than k.

I don't know a tuple could guarantee that its elements are stored in same way
as a C struct.

Regards,
Ravi


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