[section IO operators] It is possible to use `optional` with IO streams, provided that `T` can be used with streams. IOStream operators are defined in a separate header. `` #include #include int main() { boost::optional o1 = 1, oN = boost::none; std::cout << o1; std::cin >> oN; } `` The current implementation does not guarantee any particular output. What it guarantees is that if streaming out and then back in `T` gives the same value, then streaming out and then back in `optional` will also give back the same result: `` #include #include #include int main() { boost::optional o1 = 1, oN = boost::none; boost::optional x1, x2; std::stringstream s; s << o1 << oN; s >> x1 >> x2; assert (o1 == x1); assert (oN == x2); } `` [endsect]