|
Boost Users : |
Subject: [Boost-users] [Boost.Container] Performance of static_vector with default_init_t
From: dariomt_at_[hidden]
Date: 2016-12-01 08:09:48
Hi,
I'm constructing a static_vector<double,N>(n, default_init).
I was expecting the constructor call to vanish into just setting the start
pointer and the size & capacity members (and verifying n<=N).
However, the profiler is showing some time spent in the loop
inside uninitialized_default_init_alloc_n
(boost/container/detail/utilities.hpp:678)
For a builtin type and default_init_t, why do we even need to invoke the
allocator? Can't we just leave the memory uninitialized?
This is with Boost 1.55 and VS2008
Thanks in advance
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