
19 Sep
2007
19 Sep
'07
1:14 p.m.
Hi, Could you see the following tests: #include <boost/optional/optional.hpp> #include <cassert> int main() { { int const i = 10; boost::optional<int const &> o(i); assert(*o == 10); assert(&*o == &i); // ok } { int const i = 10; boost::optional<int const &> o = i; // copy-initialization assert(*o == 10); assert(&*o == &i); // failed on gcc3.4 and 4.1. } } For some reason, msvc passes this. Is this a bug, or copy-initialization is prohibited? Regards, -- Shunsuke Sogame