$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: [boost] [optional] Incorrect example
From: Ahmed Charles (ahmedcharles_at_[hidden])
Date: 2011-04-07 17:23:15
int x = 1 ;
int& rx = x ;
optional<int&> ora ;
optional<int&> orb(x) ;
ora = orb ; // now 'ora' is bound to 'x' through 'rx'
*ora = 2 ; // Changes value of 'x' through '
ora'assert(x==2);
Either the comment on the fifth line is wrong or the fourth line
should construct from rx rather than x.