Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-09-21 13:59:03


From: "Maxim Yegorushkin" <e-maxim_at_[hidden]>
> Ben Hutchings <ben.hutchings_at_[hidden]> wrote:
>
> > There's one possible problem I noticed, which is that an allocated
> > buffer will be aligned properly for boost::detail::atomic_count but
> > perhaps might not be aligned properly for char_t (or to whatever
> > buffer_storage_alignment specifies). Let me apply the James Kanze
> > test [*]: is it safe to create a const_string<double> on a SPARC?
> >
> > [*] See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8670> if you
> > don't know what I'm talking about.
>
> No, it's not safe now. I'll fix it.
>
> But I wonder, why would anyone want to instantiate a string type with
> double? How is it better than a std::vector<double>, which seems to be a
> natural choice?

He wasn't suggesting that anyone would. He was suggesting that
you don't know the alignment requirements of char_t, so one way
to test your alignment assumptions is to use double.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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