Boost logo

Boost :

Subject: [boost] boost::variant and "Current Approach: Temporary Heap Backup" vs "An Initial Solution: Double Storage"
From: Peter Foelsche (peter_foelsche_at_[hidden])
Date: 2009-09-30 17:18:28


1)
boost::variant and "Current Approach: Temporary Heap Backup" vs "An Initial
Solution: Double Storage"
Please provide both solutions. A potential heap allocation may prevent
certain application areas.

2)
I also do not understand that exception safety requires that the variant is
never empty (e.g. empty() returning always false).
What is the use of calling the constructor (of which type btw?)
if somebody creates an unintialized variant variable?
Or: In the following piece of code is the std::string constructor being
called?

boost::variant<std::string, int> s;

Thanks
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk