Hi Yusuke,
2013/6/8 Yusuke Ichinohe
Hi Michel, Akira,
I think simpler solution would be to add range support for boost::optional in additional header (e.g.
). i.e. boost::optional will become random access range. // OK #include
for (T x : r | optional_front()) { std::cout << x << std::endl } // also OK if (optional<T> x = r | optional_front()) { std::cout << x.get() << std::endl; }
// another example: #include
optional<int> x = 100; assert(boost::size(x) == 1); optional<int> y = boost::none; assert(boost::size(y) == 0); Thanks.
Thank you for your comment. That's good idea! I agree first design. But I think need more vote. Thanks, Akira
======================== Akira Takahashi mailto:faithandbrave@gmail.com https://sites.google.com/site/faithandbrave/about/en