Boost logo

Boost :

Subject: Re: [boost] Boost.Align review begins today
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2014-04-21 01:52:31


On Sunday 20 April 2014 21:46:34 Mostafa wrote:
> 3. Implementation
> 3.1) Why not reuse boost::static_unsigned_max in max_align?
> 3.2) Why not the more readable
> "boost::integer_traits<std::size_t>::const_max"
> instead of the less readable "~static_cast<std::size_t>(0)"?

Since that was my suggestion, I'll comment on that. I'm aware of Boost.Integer
but still suggested the "~static_cast<std::size_t>(0)" variant to avoid the
dependency and integer_traits template instantiation cost. integer_traits.hpp
header is considerably heavier to include than the max_count_of.hpp. I believe
static_unsigned_max is not used in max_align.hpp for the same reasons.

IMO the current code in Boost.Align is quite readable as it is and using
Boost.Integer primitive wouldn't improve readability too much to justify the
costs.


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