On 5 October 2017 at 20:23, Thorsten Ottosen via Boost < boost@lists.boost.org> wrote:
Cute.
I'll tell the wife! But would one not use std::is_trivially_copyable instead of
std::is_arithmetic?
The std::vector code is done this way. I assume(d) the library writers are well aware of std::is_trivially_copyable.
And instead of resize, should you not call the version that avoids double initialization?
Let me ask that question the other way around. If based on type_traits it could be worked out (at compile-time) that double initialization can be avoided, why doesn't resize() do the "right" thing on it's own? resize() should do what it says it does, and do that in the optimal way, given T. degski -- "*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend, Schmerzen aus Schwäche stillend.*" - Novalis 1798