mirror of
https://github.com/boostorg/optional.git
synced 2025-07-30 12:37:19 +02:00
Add a forward declaration of the ostream operator for optional. Fixes #2103.
[SVN r82930]
This commit is contained in:
committed by
Andrzej Krzemienski
parent
8d6f6ddf4f
commit
60f3efc852
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
@ -717,6 +718,11 @@ get_pointer ( optional<T>& opt )
|
|||||||
return opt.get_ptr() ;
|
return opt.get_ptr() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward declaration to prevent operator safe-bool from being used.
|
||||||
|
template<class CharType, class CharTrait, class T>
|
||||||
|
std::basic_ostream<CharType, CharTrait>&
|
||||||
|
operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v);
|
||||||
|
|
||||||
// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
|
// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
|
||||||
// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
|
// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user