
"David Abrahams"
David Walthall
writes: The only time I have found it useful to have default-constructed objects that are otherwise unusable is when I need to store them in a map or other container that requires a default constructible object.
No standard containers have that requirement, though.
This seems to be another defect, as the standard also defines the following constructor: explicit vector(size_type n, const T& value = T(), const Allocator& = Allocator()); Now how is the following code supposed to compile: #include <vector> struct X { X( int ) {} }; void f() { // Error: No default constructor for X. std::vector<X> v( 5 ); } -- Matthias Hofmann Anvil-Soft, CEO http://www.anvil-soft.com - The Creators of Toilet Tycoon http://www.anvil-soft.de - Die Macher des Klomanagers