From 60f3efc85230f82f2e0448b63f5cd1054e28b666 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 16 Feb 2013 19:32:20 +0000 Subject: [PATCH] Add a forward declaration of the ostream operator for optional. Fixes #2103. [SVN r82930] --- include/boost/optional/optional.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 674e781..062a86f 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -717,6 +718,11 @@ get_pointer ( optional& opt ) return opt.get_ptr() ; } +// Forward declaration to prevent operator safe-bool from being used. +template +std::basic_ostream& +operator<<(std::basic_ostream& out, optional const& v); + // optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values). // WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.