Boost logo

Boost Users :

Subject: [Boost-users] std::vector and default constructor
From: peter_foelsche_at_[hidden]
Date: 2008-11-21 15:31:56

It would be helpful to have something like std::vector which allows one to pass some argument which is in turn passed to the constructor of every element so that not the default constructor is being called.

This would be helpful for e.g. objects located in memory created by memory mapped files.




"The first point (using an init() function in preference to a constructor) is bogus. Using constructors and exception handling is a more general and systematic way of dealing with resource acquisition and initialization errors. This style is a relic of pre-exception C++." -- Stroustrup


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at