15 Sep
2006
15 Sep
'06
5:03 p.m.
David Walthall
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.
That allows me to use the easier operator[] syntax instead of using insert and find. However, I've begun to view that as a defect in the interface of std::map rather than a need to have default constructible objects even when they are not usable.
Maybe it's a defect in your desire to avoid find/insert. :) -- Dave Abrahams Boost Consulting www.boost-consulting.com