Changeset - ad127c5dd6c2
include/boost/utility/addressof.hpp
Show inline comments
 
deleted file
include/boost/utility/base_from_member.hpp
Show inline comments
 
deleted file
include/boost/utility/binary.hpp
Show inline comments
 
deleted file
include/boost/utility/compare_pointees.hpp
Show inline comments
 
deleted file
include/boost/utility/declval.hpp
Show inline comments
 
deleted file
include/boost/utility/detail/in_place_factory_prefix.hpp
Show inline comments
 
deleted file
include/boost/utility/detail/in_place_factory_suffix.hpp
Show inline comments
 
deleted file
include/boost/utility/detail/result_of_iterate.hpp
Show inline comments
 
deleted file
include/boost/utility/empty_deleter.hpp
Show inline comments
 
deleted file
include/boost/utility/enable_if.hpp
Show inline comments
 
deleted file
include/boost/utility/explicit_operator_bool.hpp
Show inline comments
 
/*
 
 * Copyright (c) 2014 Glen Fernandes
 
 *          Copyright Andrey Semashev 2007 - 2013.
 
 * 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)
 
 */
 

	
 
/*!
 
 * \file   explicit_operator_bool.hpp
 
 * \author Andrey Semashev
 
 * \date   08.03.2009
 
 *
 
 * 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)
 
 * This header defines a compatibility macro that implements an unspecified
 
 * \c bool operator idiom, which is superseded with explicit conversion operators in
 
 * C++11.
 
 */
 

	
 
#ifndef BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
 
#define BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
 
#ifndef BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
 
#define BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
 

	
 
#include <boost/config.hpp>
 

	
 
#ifdef BOOST_HAS_PRAGMA_ONCE
 
#pragma once
 
#endif
 

	
 
#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
 

	
 
/*!
 
 * \brief The macro defines an 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 <tt>operator!</tt>,
 
 * in terms of which the conversion operator will be implemented.
 
 */
 
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
 
    BOOST_FORCEINLINE explicit operator bool () const\
 
    {\
 
        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 <tt>operator!</tt>,
 
 * 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
 
 *
 
 * The macro should be used inside the definition of a class that has to
 
 * support the conversion. The class should also implement <tt>operator!</tt>,
 
 * 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_NOEXCEPT\
 
    {\
 
        return !this->operator! ();\
 
    }
 

	
 
#else // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
 

	
 
#if (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
 
// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
 
#define BOOST_NO_UNSPECIFIED_BOOL
 
#endif // (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
 

	
 
// The header file at this path is deprecated;
 
// use boost/core/explicit_operator_bool.hpp instead.
 
#if !defined(BOOST_NO_UNSPECIFIED_BOOL)
 

	
 
#include <boost/core/explicit_operator_bool.hpp>
 
namespace boost {
 

	
 
namespace detail {
 

	
 
#if !defined(_MSC_VER) && !defined(__IBMCPP__)
 

	
 
    struct unspecified_bool
 
    {
 
        // NOTE TO THE USER: If you see this in error messages then you tried
 
        // to apply an unsupported operator on the object that supports
 
        // explicit conversion to bool.
 
        struct OPERATORS_NOT_ALLOWED;
 
        static void true_value(OPERATORS_NOT_ALLOWED*) {}
 
    };
 
    typedef void (*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
 

	
 
#else
 

	
 
    // MSVC and VACPP are too eager to convert pointer to function to void* even though they shouldn't
 
    struct unspecified_bool
 
    {
 
        // NOTE TO THE USER: If you see this in error messages then you tried
 
        // to apply an unsupported operator on the object that supports
 
        // explicit conversion to bool.
 
        struct OPERATORS_NOT_ALLOWED;
 
        void true_value(OPERATORS_NOT_ALLOWED*) {}
 
    };
 
    typedef void (unspecified_bool::*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
 

	
 
#endif
 

	
 
} // namespace detail
 

	
 
} // namespace boost
 

	
 
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
 
    BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const\
 
    {\
 
        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_NOEXCEPT\
 
    {\
 
        return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
 
    }
 

	
 
#else // !defined(BOOST_NO_UNSPECIFIED_BOOL)
 

	
 
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
 
    BOOST_FORCEINLINE operator bool () const\
 
    {\
 
        return !this->operator! ();\
 
    }
 

	
 
#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
 
    BOOST_FORCEINLINE operator bool () const BOOST_NOEXCEPT\
 
    {\
 
        return !this->operator! ();\
 
    }
 

	
 
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
 
    BOOST_FORCEINLINE BOOST_CONSTEXPR operator bool () const BOOST_NOEXCEPT\
 
    {\
 
        return !this->operator! ();\
 
    }
 

	
 
#endif // !defined(BOOST_NO_UNSPECIFIED_BOOL)
 

	
 
#endif // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
 

	
 
#endif // BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
include/boost/utility/identity_type.hpp
Show inline comments
 
deleted file
include/boost/utility/in_place_factory.hpp
Show inline comments
 
deleted file
include/boost/utility/result_of.hpp
Show inline comments
 
deleted file
include/boost/utility/string_ref.hpp
Show inline comments
 
deleted file
include/boost/utility/string_ref_fwd.hpp
Show inline comments
 
deleted file
include/boost/utility/swap.hpp
Show inline comments
 
deleted file
include/boost/utility/typed_in_place_factory.hpp
Show inline comments
 
deleted file
include/boost/utility/value_init.hpp
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)