diff --git a/doc/fixes/boost_1_55_0/libs/utility/doc/html/explicit_operator_bool.html b/doc/fixes/boost_1_55_0/libs/utility/doc/html/explicit_operator_bool.html new file mode 100644 index 00000000..78a844f9 --- /dev/null +++ b/doc/fixes/boost_1_55_0/libs/utility/doc/html/explicit_operator_bool.html @@ -0,0 +1,115 @@ + +
+ +![]() |
+Home | +Libraries | +People | +FAQ | +More | +
Copyright © 2013 Andrey Semashev
+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +
+
+ BOOST_EXPLICIT_OPERATOR_BOOL() and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() are compatibility helper macros that expand
+ to an explicit conversion operator to bool.
+ For compilers not supporting explicit conversion operators introduced in C++11
+ the macros expand to a conversion operator that implements the safe
+ bool idiom. In case if the compiler is not able to handle safe bool
+ idiom well the macros expand to a regular conversion operator to bool.
+
+ Both macros are intended to be placed within a user's class definition. The
+ generated conversion operators will be implemented in terms of operator!()
+ that should be defined by user in this class. In case of BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() the generated conversion operator will be
+ declared constexpr which requires
+ the corresponding operator!()
+ to also be constexpr.
+
template< typename T > +class my_ptr +{ + T* m_p; + +public: + BOOST_EXPLICIT_OPERATOR_BOOL() + + bool operator!() const + { + return !m_p; + } +}; ++
+ Now my_ptr can be used in conditional
+ expressions, similarly to a regular pointer:
+
my_ptr< int > p; +if (p) + std::cout << "true" << std::endl; ++
Last revised: November 17, 2013 at 17:08:52 GMT |
++ |
Boost
+ Utility LibraryThe Boost Utility Library isn't really a single library at all. It is just a + collection for components too small to be called libraries in their own right.
+But that doesn't mean there isn't useful stuff here. Take a look:
++++ addressof
+
+ assert
+ base_from_member
+ BOOST_BINARY
+ call_traits
+ checked_delete
+ compressed_pair
+ current_function
+ declval
+ enable_if
+ in_place_factory
+ iterator_adaptors
+ generator iterator adaptors
+ next/prior
+ noncopyable
+ operators
+ result_of
+ swap
+ throw_exception
+ utility
+ string_ref
+ value_init
+ BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL +
© Copyright Beman Dawes, 2001
+Distributed under the Boost Software License, Version 1.0. (See + accompanying file + LICENSE_1_0.txt or copy at + + www.boost.org/LICENSE_1_0.txt)
+Revised + 07 November, 2006
+ +