diff --git a/doc/explicit_operator_bool.qbk b/doc/explicit_operator_bool.qbk
index 4a7e4b1..64c5be4 100644
--- a/doc/explicit_operator_bool.qbk
+++ b/doc/explicit_operator_bool.qbk
@@ -5,7 +5,7 @@
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
-[article BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL
+[article BOOST_EXPLICIT_OPERATOR_BOOL, BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL
[quickbook 1.5]
[authors [Semashev, Andrey]]
[copyright 2013 Andrey Semashev]
@@ -20,7 +20,7 @@
[section Overview]
[/===============]
-`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 [@http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Safe_bool 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`.
+`BOOST_EXPLICIT_OPERATOR_BOOL()`, `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()` 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 [@http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Safe_bool 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`.
[endsect]
@@ -62,7 +62,3 @@ Now `my_ptr` can be used in conditional expressions, similarly to a regular poin
* The macro was extracted from Boost.Log.
[endsect]
-
-
-
-
diff --git a/include/boost/noncopyable.hpp b/include/boost/noncopyable.hpp
index eb8e2e7..50eb966 100644
--- a/include/boost/noncopyable.hpp
+++ b/include/boost/noncopyable.hpp
@@ -22,19 +22,19 @@ namespace noncopyable_ // protection from unintended ADL
{
class noncopyable
{
- protected:
-#ifndef BOOST_NO_DEFAULTED_FUNCTIONS
- BOOST_CONSTEXPR noncopyable() = default;
- ~noncopyable() = default;
+ protected:
+#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
+ BOOST_CONSTEXPR noncopyable() = default;
+ ~noncopyable() = default;
#else
- noncopyable() {}
+ noncopyable() {}
~noncopyable() {}
#endif
-#ifndef BOOST_NO_DELETED_FUNCTIONS
- noncopyable( const noncopyable& ) = delete;
- noncopyable& operator=( const noncopyable& ) = delete;
+#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
+ noncopyable( const noncopyable& ) = delete;
+ noncopyable& operator=( const noncopyable& ) = delete;
#else
- private: // emphasize the following members are private
+ private: // emphasize the following members are private
noncopyable( const noncopyable& );
noncopyable& operator=( const noncopyable& );
#endif
diff --git a/include/boost/utility/explicit_operator_bool.hpp b/include/boost/utility/explicit_operator_bool.hpp
index 650caff..e16f34d 100644
--- a/include/boost/utility/explicit_operator_bool.hpp
+++ b/include/boost/utility/explicit_operator_bool.hpp
@@ -38,6 +38,19 @@
return !this->operator! ();\
}
+/*!
+ * \brief The macro defines a noexcept explicit operator of conversion to \c bool
+ *
+ * The macro should be used inside the definition of a class that has to
+ * support the conversion. The class should also implement operator!,
+ * in terms of which the conversion operator will be implemented.
+ */
+#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
+ BOOST_FORCEINLINE explicit operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
/*!
* \brief The macro defines a constexpr explicit operator of conversion to \c bool
*
@@ -46,7 +59,7 @@
* in terms of which the conversion operator will be implemented.
*/
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
- BOOST_FORCEINLINE BOOST_CONSTEXPR explicit operator bool () const\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR explicit operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
@@ -101,8 +114,14 @@ namespace detail {
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
+#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
+ BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
+ {\
+ return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
+ }
+
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
- BOOST_FORCEINLINE BOOST_CONSTEXPR operator boost::detail::unspecified_bool_type () const\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
{\
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
@@ -115,8 +134,14 @@ namespace detail {
return !this->operator! ();\
}
+#define BOOST_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
- BOOST_FORCEINLINE BOOST_CONSTEXPR operator bool () const\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
diff --git a/index.html b/index.html
index e92da2a..d38b541 100644
--- a/index.html
+++ b/index.html
@@ -34,7 +34,7 @@
utility
string_ref
value_init
- BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL
+ BOOST_EXPLICIT_OPERATOR_BOOL, BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL