From 1ed9aaa2a44a5e648cf0cd8bb73762e9da8f49d5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 1 Jun 2014 03:22:30 +0300 Subject: [PATCH] Remove headers that have been moved into core. --- include/boost/checked_delete.hpp | 69 ------------ include/boost/noncopyable.hpp | 48 --------- include/boost/ref.hpp | 120 --------------------- include/boost/utility/addressof.hpp | 162 ---------------------------- include/boost/utility/enable_if.hpp | 119 -------------------- 5 files changed, 518 deletions(-) delete mode 100644 include/boost/checked_delete.hpp delete mode 100644 include/boost/noncopyable.hpp delete mode 100644 include/boost/ref.hpp delete mode 100644 include/boost/utility/addressof.hpp delete mode 100644 include/boost/utility/enable_if.hpp diff --git a/include/boost/checked_delete.hpp b/include/boost/checked_delete.hpp deleted file mode 100644 index 9bb84e8..0000000 --- a/include/boost/checked_delete.hpp +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED -#define BOOST_CHECKED_DELETE_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/checked_delete.hpp -// -// Copyright (c) 2002, 2003 Peter Dimov -// Copyright (c) 2003 Daniel Frey -// Copyright (c) 2003 Howard Hinnant -// -// 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) -// -// See http://www.boost.org/libs/utility/checked_delete.html for documentation. -// - -namespace boost -{ - -// verify that types are complete for increased safety - -template inline void checked_delete(T * x) -{ - // intentionally complex - simplification causes regressions - typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; - (void) sizeof(type_must_be_complete); - delete x; -} - -template inline void checked_array_delete(T * x) -{ - typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; - (void) sizeof(type_must_be_complete); - delete [] x; -} - -template struct checked_deleter -{ - typedef void result_type; - typedef T * argument_type; - - void operator()(T * x) const - { - // boost:: disables ADL - boost::checked_delete(x); - } -}; - -template struct checked_array_deleter -{ - typedef void result_type; - typedef T * argument_type; - - void operator()(T * x) const - { - boost::checked_array_delete(x); - } -}; - -} // namespace boost - -#endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED diff --git a/include/boost/noncopyable.hpp b/include/boost/noncopyable.hpp deleted file mode 100644 index 50eb966..0000000 --- a/include/boost/noncopyable.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// Boost noncopyable.hpp header file --------------------------------------// - -// (C) Copyright Beman Dawes 1999-2003. 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) - -// See http://www.boost.org/libs/utility for documentation. - -#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED -#define BOOST_NONCOPYABLE_HPP_INCLUDED - -#include - -namespace boost { - -// Private copy constructor and copy assignment ensure classes derived from -// class noncopyable cannot be copied. - -// Contributed by Dave Abrahams - -namespace noncopyable_ // protection from unintended ADL -{ - class noncopyable - { - 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() {} -#endif -#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) - noncopyable( const noncopyable& ) = delete; - noncopyable& operator=( const noncopyable& ) = delete; -#else - private: // emphasize the following members are private - noncopyable( const noncopyable& ); - noncopyable& operator=( const noncopyable& ); -#endif - }; -} - -typedef noncopyable_::noncopyable noncopyable; - -} // namespace boost - -#endif // BOOST_NONCOPYABLE_HPP_INCLUDED diff --git a/include/boost/ref.hpp b/include/boost/ref.hpp deleted file mode 100644 index e31b167..0000000 --- a/include/boost/ref.hpp +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef BOOST_REF_HPP_INCLUDED -#define BOOST_REF_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -#include -#include -#include -#include - -// -// ref.hpp - ref/cref, useful helper functions -// -// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) -// Copyright (C) 2001, 2002 Peter Dimov -// Copyright (C) 2002 David Abrahams -// -// 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) -// -// See http://www.boost.org/libs/bind/ref.html for documentation. -// - -namespace boost -{ - -template class reference_wrapper -{ -public: - typedef T type; - - BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {} - - BOOST_FORCEINLINE operator T& () const { return *t_; } - - BOOST_FORCEINLINE T& get() const { return *t_; } - - BOOST_FORCEINLINE T* get_pointer() const { return t_; } - -private: - - T* t_; -}; - -# if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) -# define BOOST_REF_CONST -# else -# define BOOST_REF_CONST const -# endif - -template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST ref(T & t) -{ - return reference_wrapper(t); -} - -template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST cref(T const & t) -{ - return reference_wrapper(t); -} - -# undef BOOST_REF_CONST - - -template -class is_reference_wrapper - : public mpl::false_ -{ -}; - -template -class unwrap_reference -{ - public: - typedef T type; -}; - -# define AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(X) \ -template \ -class is_reference_wrapper< X > \ - : public mpl::true_ \ -{ \ -}; \ -\ -template \ -class unwrap_reference< X > \ -{ \ - public: \ - typedef T type; \ -}; \ -/**/ - -AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper) -#if !defined(BOOST_NO_CV_SPECIALIZATIONS) -AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper const) -AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper volatile) -AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper const volatile) -#endif - -# undef AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF - - -template BOOST_FORCEINLINE typename unwrap_reference::type& -unwrap_ref(T& t) -{ - return t; -} - -template BOOST_FORCEINLINE T* get_pointer( reference_wrapper const & r ) -{ - return r.get_pointer(); -} - -} // namespace boost - -#endif // #ifndef BOOST_REF_HPP_INCLUDED diff --git a/include/boost/utility/addressof.hpp b/include/boost/utility/addressof.hpp deleted file mode 100644 index ef5639f..0000000 --- a/include/boost/utility/addressof.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (C) 2002 Brad King (brad.king@kitware.com) -// Douglas Gregor (gregod@cs.rpi.edu) -// -// Copyright (C) 2002, 2008, 2013 Peter Dimov -// -// 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) - -// For more information, see http://www.boost.org - -#ifndef BOOST_UTILITY_ADDRESSOF_HPP -# define BOOST_UTILITY_ADDRESSOF_HPP - -# include -# include -# include - -namespace boost -{ - -namespace detail -{ - -template struct addr_impl_ref -{ - T & v_; - - BOOST_FORCEINLINE addr_impl_ref( T & v ): v_( v ) {} - BOOST_FORCEINLINE operator T& () const { return v_; } - -private: - addr_impl_ref & operator=(const addr_impl_ref &); -}; - -template struct addressof_impl -{ - static BOOST_FORCEINLINE T * f( T & v, long ) - { - return reinterpret_cast( - &const_cast(reinterpret_cast(v))); - } - - static BOOST_FORCEINLINE T * f( T * v, int ) - { - return v; - } -}; - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -#if defined( __clang__ ) && !defined( _LIBCPP_VERSION ) && !defined( BOOST_NO_CXX11_DECLTYPE ) - - typedef decltype(nullptr) addr_nullptr_t; - -#else - - typedef std::nullptr_t addr_nullptr_t; - -#endif - -template<> struct addressof_impl< addr_nullptr_t > -{ - typedef addr_nullptr_t T; - - static BOOST_FORCEINLINE T * f( T & v, int ) - { - return &v; - } -}; - -template<> struct addressof_impl< addr_nullptr_t const > -{ - typedef addr_nullptr_t const T; - - static BOOST_FORCEINLINE T * f( T & v, int ) - { - return &v; - } -}; - -template<> struct addressof_impl< addr_nullptr_t volatile > -{ - typedef addr_nullptr_t volatile T; - - static BOOST_FORCEINLINE T * f( T & v, int ) - { - return &v; - } -}; - -template<> struct addressof_impl< addr_nullptr_t const volatile > -{ - typedef addr_nullptr_t const volatile T; - - static BOOST_FORCEINLINE T * f( T & v, int ) - { - return &v; - } -}; - -#endif - -} // namespace detail - -template -BOOST_FORCEINLINE -T * addressof( T & v ) -{ -#if (defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC ) - - return boost::detail::addressof_impl::f( v, 0 ); - -#else - - return boost::detail::addressof_impl::f( boost::detail::addr_impl_ref( v ), 0 ); - -#endif -} - -#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) ) - -namespace detail -{ - -template struct addressof_addp -{ - typedef T * type; -}; - -} // namespace detail - -template< class T, std::size_t N > -BOOST_FORCEINLINE -typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] ) -{ - return &t; -} - -#endif - -// Borland doesn't like casting an array reference to a char reference -// but these overloads work around the problem. -#if defined( __BORLANDC__ ) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -template -BOOST_FORCEINLINE -T (*addressof(T (&t)[N]))[N] -{ - return reinterpret_cast(&t); -} - -template -BOOST_FORCEINLINE -const T (*addressof(const T (&t)[N]))[N] -{ - return reinterpret_cast(&t); -} -#endif - -} // namespace boost - -#endif // BOOST_UTILITY_ADDRESSOF_HPP diff --git a/include/boost/utility/enable_if.hpp b/include/boost/utility/enable_if.hpp deleted file mode 100644 index d292c6a..0000000 --- a/include/boost/utility/enable_if.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// Boost enable_if library - -// Copyright 2003 (c) The Trustees of Indiana University. - -// Use, modification, and distribution is subject to 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) - -// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu) -// Jeremiah Willcock (jewillco at osl.iu.edu) -// Andrew Lumsdaine (lums at osl.iu.edu) - - -#ifndef BOOST_UTILITY_ENABLE_IF_HPP -#define BOOST_UTILITY_ENABLE_IF_HPP - -#include "boost/config.hpp" - -// Even the definition of enable_if causes problems on some compilers, -// so it's macroed out for all compilers that do not support SFINAE - -#ifndef BOOST_NO_SFINAE - -namespace boost -{ - - template - struct enable_if_c { - typedef T type; - }; - - template - struct enable_if_c {}; - - template - struct enable_if : public enable_if_c {}; - - template - struct lazy_enable_if_c { - typedef typename T::type type; - }; - - template - struct lazy_enable_if_c {}; - - template - struct lazy_enable_if : public lazy_enable_if_c {}; - - - template - struct disable_if_c { - typedef T type; - }; - - template - struct disable_if_c {}; - - template - struct disable_if : public disable_if_c {}; - - template - struct lazy_disable_if_c { - typedef typename T::type type; - }; - - template - struct lazy_disable_if_c {}; - - template - struct lazy_disable_if : public lazy_disable_if_c {}; - -} // namespace boost - -#else - -namespace boost { - - namespace detail { typedef void enable_if_default_T; } - - template - struct enable_if_does_not_work_on_this_compiler; - - template - struct enable_if_c : enable_if_does_not_work_on_this_compiler - { }; - - template - struct disable_if_c : enable_if_does_not_work_on_this_compiler - { }; - - template - struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler - { }; - - template - struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler - { }; - - template - struct enable_if : enable_if_does_not_work_on_this_compiler - { }; - - template - struct disable_if : enable_if_does_not_work_on_this_compiler - { }; - - template - struct lazy_enable_if : enable_if_does_not_work_on_this_compiler - { }; - - template - struct lazy_disable_if : enable_if_does_not_work_on_this_compiler - { }; - -} // namespace boost - -#endif // BOOST_NO_SFINAE - -#endif