
AMDG Peter Foelsche wrote:
"Peter Foelsche" <peter_foelsche@agilent.com> wrote in message news:ha0hv5$7sj$1@ger.gmane.org...
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.
from the documentation:
1) Copy-construct the content of the left-hand side to the heap; call the pointer to this data backup. 2) Destroy the content of the left-hand side. 3) Copy-construct the content of the right-hand side in the (now-empty) storage of the left-hand side. 4) In the event of failure, copy backup to the left-hand side storage.
step 4 may throw too in which case the variant is corrupted.
It can't throw because it is only copying a pointer. In Christ, Steven Watanabe