Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-09-15 13:03:42


David Walthall <walthall_at_[hidden]> 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.

> 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

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