I have a symbol table implemented as a std::map
. For the value, there is no way to legitimately construct an instance of the value type via a default constructo
Your V
doesn't have a default constructor, so you cannot really expect std::map
std::map
to be usable.
A std::map
does have a mapped_type
that is default-constructible, and likely has the semantics you want. Refer to the Boost.Optional documentation for details (you will need to be aware of them).