diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2024-12-18 19:38:10 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2024-12-18 20:04:03 +0300 |
commit | 63b761dc56f5b3dc626b09c3ef72e251b8a99858 (patch) | |
tree | 2bcaa4b35ed9bb846eee088be63ae4adf59e5a8f | |
parent | 7ed76959e6c06dbc4c249ce0f3b930463a6b65db (diff) | |
download | ydb-63b761dc56f5b3dc626b09c3ef72e251b8a99858.tar.gz |
Update contrib/restricted/boost/smart_ptr to 1.87.0
commit_hash:b9bb13823fe5b1f2e0453b65ba86ae555d8483d5
56 files changed, 866 insertions, 2373 deletions
diff --git a/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.copyrights.report b/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.copyrights.report index ddbcac7192..b6e5405282 100644 --- a/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.copyrights.report +++ b/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.copyrights.report @@ -115,7 +115,6 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/smart_ptr/detail/requires_cxx11.hpp [4:6] include/boost/smart_ptr/detail/sp_thread_pause.hpp [4:6] include/boost/smart_ptr/detail/sp_thread_sleep.hpp [4:6] include/boost/smart_ptr/detail/sp_thread_yield.hpp [4:6] @@ -199,13 +198,15 @@ BELONGS ya.make KEEP COPYRIGHT_SERVICE_LABEL 3097182274a2e77f502de94f323359af BELONGS ya.make License text: - // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. + // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/atomic_count.hpp [13:13] + include/boost/detail/atomic_count.hpp [4:6] include/boost/smart_ptr/detail/atomic_count.hpp [13:14] include/boost/smart_ptr/detail/atomic_count_gcc.hpp [11:13] include/boost/smart_ptr/detail/atomic_count_pt.hpp [7:7] @@ -257,7 +258,6 @@ BELONGS ya.make Files with this license: include/boost/smart_ptr/detail/atomic_count_nt.hpp [11:11] include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp [9:9] - include/boost/smart_ptr/detail/sp_nullptr_t.hpp [12:12] KEEP COPYRIGHT_SERVICE_LABEL 3ca4379da2fa49ccbaaf67782ff8bd4f BELONGS ya.make @@ -469,16 +469,19 @@ BELONGS ya.make Files with this license: include/boost/smart_ptr/enable_shared_from_this.hpp [7:7] -KEEP COPYRIGHT_SERVICE_LABEL 73025b91e8cf54ab81ff410c38be7452 +KEEP COPYRIGHT_SERVICE_LABEL 726373a8b35d0ca115f5f73412514c2a BELONGS ya.make License text: - // Copyright (c) 2001-2009, 2012 Peter Dimov + // Copyright 2024 Peter Dimov + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/smart_ptr/detail/operator_bool.hpp [3:3] + include/boost/smart_ptr/detail/deprecated_macros.hpp [4:6] + include/boost/smart_ptr/detail/sp_type_traits.hpp [4:6] KEEP COPYRIGHT_SERVICE_LABEL 778d126a908ae2e1cc990627956713b8 BELONGS ya.make @@ -521,13 +524,15 @@ BELONGS ya.make KEEP COPYRIGHT_SERVICE_LABEL 828b79ff16e0bf70fedcf473356bf326 BELONGS ya.make License text: - // Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. + // Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/lightweight_mutex.hpp [13:13] + include/boost/detail/lightweight_mutex.hpp [4:6] include/boost/smart_ptr/detail/lightweight_mutex.hpp [13:13] KEEP COPYRIGHT_SERVICE_LABEL 897c9e939f14dd9c42b2594da26b4078 @@ -541,7 +546,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/quick_allocator.hpp [13:14] + include/boost/detail/quick_allocator.hpp [4:7] include/boost/smart_ptr.hpp [10:12] include/boost/smart_ptr/detail/quick_allocator.hpp [13:14] @@ -594,14 +599,16 @@ BELONGS ya.make KEEP COPYRIGHT_SERVICE_LABEL 9f416aa8f1e6678b0d6d5857d642b969 BELONGS ya.make License text: - // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. - // Copyright (c) 2008, 2018 Peter Dimov + // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. + // Copyright (c) 2008, 2018 Peter Dimov + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/lightweight_thread.hpp [12:13] + include/boost/detail/lightweight_thread.hpp [4:7] include/boost/smart_ptr/detail/lightweight_thread.hpp [12:13] include/boost/smart_ptr/detail/lwm_pthreads.hpp [13:13] @@ -644,14 +651,16 @@ BELONGS ya.make KEEP COPYRIGHT_SERVICE_LABEL a81f16b19633169e29f73443fb23e585 BELONGS ya.make License text: - // Copyright (c) 2003 David Abrahams - // Copyright (c) 2003 Peter Dimov + // Copyright (c) 2003 David Abrahams + // Copyright (c) 2003 Peter Dimov + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/quick_allocator.hpp [13:14] + include/boost/detail/quick_allocator.hpp [4:7] include/boost/smart_ptr/detail/quick_allocator.hpp [13:14] KEEP COPYRIGHT_SERVICE_LABEL b13bccd796707ee307c756c5292480d5 @@ -775,17 +784,6 @@ BELONGS ya.make Files with this license: include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp [5:5] -KEEP COPYRIGHT_SERVICE_LABEL df0ccc1d436763dd3030b1b12f23d451 -BELONGS ya.make - License text: - // Copyright 2008,2012 Peter Dimov - Scancode info: - Original SPDX id: COPYRIGHT_SERVICE_LABEL - Score : 100.00 - Match type : COPYRIGHT - Files with this license: - include/boost/smart_ptr/detail/sp_forward.hpp [12:12] - KEEP COPYRIGHT_SERVICE_LABEL e323857368fb1433c9c3079428ca51d3 BELONGS ya.make License text: @@ -868,14 +866,16 @@ BELONGS ya.make KEEP COPYRIGHT_SERVICE_LABEL f1024c091dd2c793b61b861740198222 BELONGS ya.make License text: - // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. - // Copyright (c) 2008, 2018 Peter Dimov + // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. + // Copyright (c) 2008, 2018 Peter Dimov + // Distributed under the Boost Software License, Version 1.0. + // https://www.boost.org/LICENSE_1_0.txt Scancode info: Original SPDX id: COPYRIGHT_SERVICE_LABEL Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/detail/lightweight_thread.hpp [12:13] + include/boost/detail/lightweight_thread.hpp [4:7] include/boost/smart_ptr/detail/lightweight_thread.hpp [12:13] KEEP COPYRIGHT_SERVICE_LABEL f68164228ffa5c0764d510b1da25be15 diff --git a/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.licenses.report b/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.licenses.report index c332f94713..67f92c5634 100644 --- a/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.licenses.report +++ b/contrib/restricted/boost/smart_ptr/.yandex_meta/devtools.licenses.report @@ -48,21 +48,6 @@ BELONGS ya.make Files with this license: include/boost/pointer_to_other.hpp [10:13] -KEEP BSL-1.0 3a9fe8c6f3dc56da59da6bb70a0cef2c -BELONGS ya.make - License text: - Distributed under the Boost Software License, Version 1.0. - (http://www.boost.org/LICENSE_1_0.txt) - Scancode info: - Original SPDX id: BSL-1.0 - Score : 94.44 - Match type : NOTICE - Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 - Files with this license: - include/boost/smart_ptr/allocate_shared_array.hpp [5:6] - include/boost/smart_ptr/allocate_unique.hpp [5:6] - include/boost/smart_ptr/make_unique.hpp [5:6] - KEEP BSL-1.0 47a0454637d4fa45d78eb2557ccd70c4 BELONGS ya.make License text: @@ -112,8 +97,11 @@ BELONGS ya.make Files with this license: include/boost/make_unique.hpp [6:6] include/boost/smart_ptr/allocate_local_shared_array.hpp [6:6] + include/boost/smart_ptr/allocate_shared_array.hpp [6:6] + include/boost/smart_ptr/allocate_unique.hpp [6:6] include/boost/smart_ptr/make_local_shared_array.hpp [7:7] include/boost/smart_ptr/make_shared_array.hpp [6:6] + include/boost/smart_ptr/make_unique.hpp [6:6] KEEP BSL-1.0 6fb8dab2fa17abac18f239108501392d BELONGS ya.make @@ -141,10 +129,6 @@ BELONGS ya.make Match type : NOTICE Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 Files with this license: - include/boost/detail/atomic_count.hpp [15:17] - include/boost/detail/lightweight_mutex.hpp [15:17] - include/boost/detail/lightweight_thread.hpp [15:17] - include/boost/detail/quick_allocator.hpp [16:18] include/boost/enable_shared_from_this.hpp [9:11] include/boost/intrusive_ptr.hpp [9:11] include/boost/make_shared.hpp [8:10] @@ -153,16 +137,13 @@ BELONGS ya.make include/boost/smart_ptr/detail/atomic_count_spin.hpp [9:11] include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp [11:13] include/boost/smart_ptr/detail/lightweight_thread.hpp [15:17] - include/boost/smart_ptr/detail/operator_bool.hpp [5:7] include/boost/smart_ptr/detail/sp_convertible.hpp [14:16] include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp [16:18] include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp [16:18] include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp [14:16] include/boost/smart_ptr/detail/sp_counted_base_sync.hpp [14:16] - include/boost/smart_ptr/detail/sp_forward.hpp [14:16] include/boost/smart_ptr/detail/sp_interlocked.hpp [15:17] include/boost/smart_ptr/detail/sp_noexcept.hpp [14:16] - include/boost/smart_ptr/detail/sp_nullptr_t.hpp [14:16] include/boost/smart_ptr/enable_shared_from.hpp [8:10] include/boost/smart_ptr/enable_shared_from_raw.hpp [10:12] include/boost/smart_ptr/enable_shared_from_this.hpp [9:11] @@ -275,10 +256,16 @@ BELONGS ya.make Match type : REFERENCE Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 Files with this license: + include/boost/detail/atomic_count.hpp [6:6] + include/boost/detail/lightweight_mutex.hpp [6:6] + include/boost/detail/lightweight_thread.hpp [7:7] + include/boost/detail/quick_allocator.hpp [7:7] include/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp [11:11] + include/boost/smart_ptr/detail/deprecated_macros.hpp [6:6] include/boost/smart_ptr/detail/sp_thread_pause.hpp [6:6] include/boost/smart_ptr/detail/sp_thread_sleep.hpp [6:6] include/boost/smart_ptr/detail/sp_thread_yield.hpp [6:6] + include/boost/smart_ptr/detail/sp_type_traits.hpp [6:6] include/boost/smart_ptr/owner_equal_to.hpp [6:6] include/boost/smart_ptr/owner_hash.hpp [6:6] @@ -292,11 +279,17 @@ BELONGS ya.make Match type : NOTICE Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 Files with this license: + include/boost/detail/atomic_count.hpp [5:5] + include/boost/detail/lightweight_mutex.hpp [5:5] + include/boost/detail/lightweight_thread.hpp [6:6] + include/boost/detail/quick_allocator.hpp [6:6] include/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp [10:10] + include/boost/smart_ptr/detail/deprecated_macros.hpp [5:5] include/boost/smart_ptr/detail/lwm_std_mutex.hpp [5:5] include/boost/smart_ptr/detail/sp_thread_pause.hpp [5:5] include/boost/smart_ptr/detail/sp_thread_sleep.hpp [5:5] include/boost/smart_ptr/detail/sp_thread_yield.hpp [5:5] + include/boost/smart_ptr/detail/sp_type_traits.hpp [5:5] include/boost/smart_ptr/owner_equal_to.hpp [5:5] include/boost/smart_ptr/owner_hash.hpp [5:5] @@ -311,7 +304,6 @@ BELONGS ya.make Match type : NOTICE Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 Files with this license: - include/boost/smart_ptr/detail/requires_cxx11.hpp [5:6] include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp [13:14] include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp [14:15] include/boost/smart_ptr/detail/sp_obsolete.hpp [14:15] @@ -330,5 +322,8 @@ BELONGS ya.make Files with this license: include/boost/make_unique.hpp [5:5] include/boost/smart_ptr/allocate_local_shared_array.hpp [5:5] + include/boost/smart_ptr/allocate_shared_array.hpp [5:5] + include/boost/smart_ptr/allocate_unique.hpp [5:5] include/boost/smart_ptr/make_local_shared_array.hpp [6:6] include/boost/smart_ptr/make_shared_array.hpp [5:5] + include/boost/smart_ptr/make_unique.hpp [5:5] diff --git a/contrib/restricted/boost/smart_ptr/.yandex_meta/licenses.list.txt b/contrib/restricted/boost/smart_ptr/.yandex_meta/licenses.list.txt index 581c8e7faf..d64344d3c5 100644 --- a/contrib/restricted/boost/smart_ptr/.yandex_meta/licenses.list.txt +++ b/contrib/restricted/boost/smart_ptr/.yandex_meta/licenses.list.txt @@ -72,11 +72,6 @@ Distributed under the Boost Software License, Version 1.0. -====================BSL-1.0==================== -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) - - ====================COPYRIGHT==================== * Copyright Andrey Semashev 2007 - 2013. * Distributed under the Boost Software License, Version 1.0. @@ -109,10 +104,6 @@ Distributed under the Boost Software License, Version 1.0. ====================COPYRIGHT==================== // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. - - -====================COPYRIGHT==================== -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org> // Copyright 2003-2005 Peter Dimov @@ -164,32 +155,14 @@ Distributed under the Boost Software License, Version 1.0. ====================COPYRIGHT==================== -// Copyright (c) 2001-2009, 2012 Peter Dimov - - -====================COPYRIGHT==================== // Copyright (c) 2002 Peter Dimov ====================COPYRIGHT==================== -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2008, 2018 Peter Dimov - - -====================COPYRIGHT==================== // Copyright (c) 2002, 2003 Peter Dimov ====================COPYRIGHT==================== -// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. - - -====================COPYRIGHT==================== -// Copyright (c) 2003 David Abrahams -// Copyright (c) 2003 Peter Dimov - - -====================COPYRIGHT==================== // Copyright (c) 2003 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) @@ -284,10 +257,6 @@ Distributed under the Boost Software License, Version 1.0. ====================COPYRIGHT==================== -// Copyright 2008,2012 Peter Dimov - - -====================COPYRIGHT==================== // Copyright 2013 Peter Dimov @@ -314,6 +283,32 @@ Distributed under the Boost Software License, Version 1.0. ====================COPYRIGHT==================== +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + + +====================COPYRIGHT==================== +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008, 2018 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + + +====================COPYRIGHT==================== +// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + + +====================COPYRIGHT==================== +// Copyright (c) 2003 David Abrahams +// Copyright (c) 2003 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + + +====================COPYRIGHT==================== // Copyright 2007, 2020 Peter Dimov @@ -336,6 +331,12 @@ Distributed under the Boost Software License, Version 1.0. ====================COPYRIGHT==================== +// Copyright 2024 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + + +====================COPYRIGHT==================== Copyright 2012-2019 Glen Joseph Fernandes (glenjofe@gmail.com) diff --git a/contrib/restricted/boost/smart_ptr/include/boost/detail/atomic_count.hpp b/contrib/restricted/boost/smart_ptr/include/boost/detail/atomic_count.hpp index 5411c7ae99..ba90183504 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/detail/atomic_count.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/detail/atomic_count.hpp @@ -1,20 +1,13 @@ #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED #define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED -// MS compatible compilers support #pragma once +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif +#include <boost/config/header_deprecated.hpp> -// -// boost/detail/atomic_count.hpp - thread/SMP safe reference counter -// -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. -// -// 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_HEADER_DEPRECATED("<boost/smart_ptr/detail/atomic_count.hpp>") #include <boost/smart_ptr/detail/atomic_count.hpp> diff --git a/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_mutex.hpp b/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_mutex.hpp index b7a7f6dd4e..c681e1911e 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_mutex.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_mutex.hpp @@ -1,21 +1,13 @@ #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED #define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED -// MS compatible compilers support #pragma once +// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif +#include <boost/config/header_deprecated.hpp> -// -// boost/detail/lightweight_mutex.hpp - lightweight mutex -// -// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. -// -// 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_HEADER_DEPRECATED("<boost/smart_ptr/detail/lightweight_mutex.hpp>") #include <boost/smart_ptr/detail/lightweight_mutex.hpp> diff --git a/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_thread.hpp b/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_thread.hpp index bf94538a59..2d7ba8f0bd 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_thread.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/detail/lightweight_thread.hpp @@ -1,25 +1,14 @@ #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED #define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED -// MS compatible compilers support #pragma once +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008, 2018 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif +#include <boost/config/header_deprecated.hpp> -// boost/detail/lightweight_thread.hpp -// -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2008, 2018 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 -// -// -// typedef /*...*/ lw_thread_t; // as pthread_t -// template<class F> int lw_thread_create( lw_thread_t & th, F f ); -// void lw_thread_join( lw_thread_t th ); +BOOST_HEADER_DEPRECATED("<boost/smart_ptr/detail/lightweight_thread.hpp>") #include <boost/smart_ptr/detail/lightweight_thread.hpp> diff --git a/contrib/restricted/boost/smart_ptr/include/boost/detail/quick_allocator.hpp b/contrib/restricted/boost/smart_ptr/include/boost/detail/quick_allocator.hpp index d54b3a792d..e56142c400 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/detail/quick_allocator.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/detail/quick_allocator.hpp @@ -1,22 +1,14 @@ #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED #define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED -// MS compatible compilers support #pragma once +// Copyright (c) 2003 David Abrahams +// Copyright (c) 2003 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif +#include <boost/config/header_deprecated.hpp> -// -// detail/quick_allocator.hpp -// -// Copyright (c) 2003 David Abrahams -// Copyright (c) 2003 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 -// +BOOST_HEADER_DEPRECATED("<boost/smart_ptr/detail/quick_allocator.hpp>") #include <boost/smart_ptr/detail/quick_allocator.hpp> diff --git a/contrib/restricted/boost/smart_ptr/include/boost/pointer_cast.hpp b/contrib/restricted/boost/smart_ptr/include/boost/pointer_cast.hpp index d47327bc70..a19fcb6c72 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/pointer_cast.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/pointer_cast.hpp @@ -10,49 +10,39 @@ #ifndef BOOST_POINTER_CAST_HPP #define BOOST_POINTER_CAST_HPP -#include <boost/config.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <memory> +#include <type_traits> namespace boost { //static_pointer_cast overload for raw pointers template<class T, class U> -inline T* static_pointer_cast(U *ptr) BOOST_SP_NOEXCEPT +inline T* static_pointer_cast(U *ptr) noexcept { return static_cast<T*>(ptr); } //dynamic_pointer_cast overload for raw pointers template<class T, class U> -inline T* dynamic_pointer_cast(U *ptr) BOOST_SP_NOEXCEPT +inline T* dynamic_pointer_cast(U *ptr) noexcept { return dynamic_cast<T*>(ptr); } //const_pointer_cast overload for raw pointers template<class T, class U> -inline T* const_pointer_cast(U *ptr) BOOST_SP_NOEXCEPT +inline T* const_pointer_cast(U *ptr) noexcept { return const_cast<T*>(ptr); } //reinterpret_pointer_cast overload for raw pointers template<class T, class U> -inline T* reinterpret_pointer_cast(U *ptr) BOOST_SP_NOEXCEPT +inline T* reinterpret_pointer_cast(U *ptr) noexcept { return reinterpret_cast<T*>(ptr); } -} // namespace boost - -#if !defined( BOOST_NO_CXX11_SMART_PTR ) - -#include <boost/type_traits/has_virtual_destructor.hpp> -#include <boost/static_assert.hpp> -#include <memory> - -namespace boost { - //static_pointer_cast overload for std::shared_ptr using std::static_pointer_cast; @@ -63,7 +53,7 @@ using std::dynamic_pointer_cast; using std::const_pointer_cast; //reinterpret_pointer_cast overload for std::shared_ptr -template<class T, class U> std::shared_ptr<T> reinterpret_pointer_cast(const std::shared_ptr<U> & r ) BOOST_SP_NOEXCEPT +template<class T, class U> std::shared_ptr<T> reinterpret_pointer_cast(const std::shared_ptr<U> & r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -74,7 +64,7 @@ template<class T, class U> std::shared_ptr<T> reinterpret_pointer_cast(const std } //static_pointer_cast overload for std::unique_ptr -template<class T, class U> std::unique_ptr<T> static_pointer_cast( std::unique_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> std::unique_ptr<T> static_pointer_cast( std::unique_ptr<U> && r ) noexcept { (void) static_cast< T* >( static_cast< U* >( 0 ) ); @@ -84,11 +74,11 @@ template<class T, class U> std::unique_ptr<T> static_pointer_cast( std::unique_p } //dynamic_pointer_cast overload for std::unique_ptr -template<class T, class U> std::unique_ptr<T> dynamic_pointer_cast( std::unique_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> std::unique_ptr<T> dynamic_pointer_cast( std::unique_ptr<U> && r ) noexcept { (void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); - BOOST_STATIC_ASSERT_MSG( boost::has_virtual_destructor<T>::value, "The target of dynamic_pointer_cast must have a virtual destructor." ); + static_assert( std::has_virtual_destructor<T>::value, "The target of dynamic_pointer_cast must have a virtual destructor." ); T * p = dynamic_cast<T*>( r.get() ); if( p ) r.release(); @@ -96,7 +86,7 @@ template<class T, class U> std::unique_ptr<T> dynamic_pointer_cast( std::unique_ } //const_pointer_cast overload for std::unique_ptr -template<class T, class U> std::unique_ptr<T> const_pointer_cast( std::unique_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> std::unique_ptr<T> const_pointer_cast( std::unique_ptr<U> && r ) noexcept { (void) const_cast< T* >( static_cast< U* >( 0 ) ); @@ -106,7 +96,7 @@ template<class T, class U> std::unique_ptr<T> const_pointer_cast( std::unique_pt } //reinterpret_pointer_cast overload for std::unique_ptr -template<class T, class U> std::unique_ptr<T> reinterpret_pointer_cast( std::unique_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> std::unique_ptr<T> reinterpret_pointer_cast( std::unique_ptr<U> && r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -117,6 +107,4 @@ template<class T, class U> std::unique_ptr<T> reinterpret_pointer_cast( std::uni } // namespace boost -#endif // #if !defined( BOOST_NO_CXX11_SMART_PTR ) - #endif //BOOST_POINTER_CAST_HPP diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_local_shared_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_local_shared_array.hpp index 72ecfcf8a9..64761135f6 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_local_shared_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_local_shared_array.hpp @@ -8,9 +8,10 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/allocate_shared_array.hpp> #include <boost/smart_ptr/local_shared_ptr.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <type_traits> namespace boost { namespace detail { @@ -18,16 +19,16 @@ namespace detail { class BOOST_SYMBOL_VISIBLE lsp_array_base : public local_counted_base { public: - void set(sp_counted_base* base) BOOST_SP_NOEXCEPT { + void set(sp_counted_base* base) noexcept { count_ = shared_count(base); } - void local_cb_destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + void local_cb_destroy() noexcept override { shared_count().swap(count_); } shared_count local_cb_get_shared_count() const - BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + noexcept override { return count_; } @@ -40,10 +41,10 @@ class lsp_array_state : public sp_array_state<A> { public: template<class U> - lsp_array_state(const U& other, std::size_t size) BOOST_SP_NOEXCEPT + lsp_array_state(const U& other, std::size_t size) noexcept : sp_array_state<A>(other, size) { } - lsp_array_base& base() BOOST_SP_NOEXCEPT { + lsp_array_base& base() noexcept { return base_; } @@ -56,10 +57,10 @@ class lsp_size_array_state : public sp_size_array_state<A, N> { public: template<class U> - lsp_size_array_state(const U& other, std::size_t size) BOOST_SP_NOEXCEPT + lsp_size_array_state(const U& other, std::size_t size) noexcept : sp_size_array_state<A, N>(other, size) { } - lsp_array_base& base() BOOST_SP_NOEXCEPT { + lsp_array_base& base() noexcept { return base_; } @@ -70,7 +71,7 @@ private: } /* detail */ template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared(const A& allocator, std::size_t count) { @@ -90,12 +91,12 @@ allocate_local_shared(const A& allocator, std::size_t count) } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared(const A& allocator) { enum { - count = extent<T>::value + count = std::extent<T>::value }; typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; @@ -113,10 +114,10 @@ allocate_local_shared(const A& allocator) } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared(const A& allocator, std::size_t count, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; @@ -134,13 +135,13 @@ allocate_local_shared(const A& allocator, std::size_t count, } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared(const A& allocator, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { enum { - count = extent<T>::value + count = std::extent<T>::value }; typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; @@ -158,7 +159,7 @@ allocate_local_shared(const A& allocator, } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared_noinit(const A& allocator, std::size_t count) { @@ -167,7 +168,7 @@ allocate_local_shared_noinit(const A& allocator, std::size_t count) } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type allocate_local_shared_noinit(const A& allocator) { diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_shared_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_shared_array.hpp index f07702bdbb..59004bca5b 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_shared_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_shared_array.hpp @@ -8,27 +8,20 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/core/allocator_access.hpp> #include <boost/core/alloc_construct.hpp> #include <boost/core/first_scalar.hpp> #include <boost/smart_ptr/shared_ptr.hpp> -#include <boost/type_traits/alignment_of.hpp> -#include <boost/type_traits/enable_if.hpp> -#include <boost/type_traits/extent.hpp> -#include <boost/type_traits/is_bounded_array.hpp> -#include <boost/type_traits/is_unbounded_array.hpp> -#include <boost/type_traits/remove_cv.hpp> -#include <boost/type_traits/remove_extent.hpp> -#include <boost/type_traits/type_with_alignment.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <type_traits> namespace boost { namespace detail { template<class T> struct sp_array_element { - typedef typename boost::remove_cv<typename - boost::remove_extent<T>::type>::type type; + typedef typename std::remove_cv<typename + std::remove_extent<T>::type>::type type; }; template<class T> @@ -60,8 +53,8 @@ struct sp_align_up { }; template<class T> -BOOST_CONSTEXPR inline std::size_t -sp_objects(std::size_t size) BOOST_SP_NOEXCEPT +constexpr inline std::size_t +sp_objects(std::size_t size) noexcept { return (size + sizeof(T) - 1) / sizeof(T); } @@ -72,15 +65,15 @@ public: typedef A type; template<class U> - sp_array_state(const U& _allocator, std::size_t _size) BOOST_SP_NOEXCEPT + sp_array_state(const U& _allocator, std::size_t _size) noexcept : allocator_(_allocator), size_(_size) { } - A& allocator() BOOST_SP_NOEXCEPT { + A& allocator() noexcept { return allocator_; } - std::size_t size() const BOOST_SP_NOEXCEPT { + std::size_t size() const noexcept { return size_; } @@ -95,14 +88,14 @@ public: typedef A type; template<class U> - sp_size_array_state(const U& _allocator, std::size_t) BOOST_SP_NOEXCEPT + sp_size_array_state(const U& _allocator, std::size_t) noexcept : allocator_(_allocator) { } - A& allocator() BOOST_SP_NOEXCEPT { + A& allocator() noexcept { return allocator_; } - BOOST_CONSTEXPR std::size_t size() const BOOST_SP_NOEXCEPT { + constexpr std::size_t size() const noexcept { return N; } @@ -113,8 +106,8 @@ private: template<class T, class U> struct sp_array_alignment { enum { - value = sp_max_size<boost::alignment_of<T>::value, - boost::alignment_of<U>::value>::value + value = sp_max_size<std::alignment_of<T>::value, + std::alignment_of<U>::value>::value }; }; @@ -127,7 +120,7 @@ struct sp_array_offset { template<class U, class T> inline U* -sp_array_start(T* base) BOOST_SP_NOEXCEPT +sp_array_start(T* base) noexcept { enum { size = sp_array_offset<T, U>::value @@ -143,12 +136,12 @@ class sp_array_creator { offset = sp_array_offset<T, element>::value }; - typedef typename boost::type_with_alignment<sp_array_alignment<T, + typedef typename sp_type_with_alignment<sp_array_alignment<T, element>::value>::type type; public: template<class U> - sp_array_creator(const U& other, std::size_t size) BOOST_SP_NOEXCEPT + sp_array_creator(const U& other, std::size_t size) noexcept : other_(other), size_(sp_objects<type>(offset + sizeof(element) * size)) { } @@ -192,33 +185,33 @@ public: boost::first_scalar(&list), count); } - T& state() BOOST_SP_NOEXCEPT { + T& state() noexcept { return state_; } - void dispose() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + void dispose() noexcept override { boost::alloc_destroy_n(state_.allocator(), boost::first_scalar(sp_array_start<type>(this)), state_.size() * sp_array_count<type>::value); } - void destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + void destroy() noexcept override { sp_array_creator<allocator, sp_array_base> other(state_.allocator(), state_.size()); this->~sp_array_base(); other.destroy(this); } - void* get_deleter(const sp_typeinfo_&) BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + void* get_deleter(const sp_typeinfo_&) noexcept override { return 0; } void* get_local_deleter(const sp_typeinfo_&) - BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + noexcept override { return 0; } - void* get_untyped_deleter() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { + void* get_untyped_deleter() noexcept override { return 0; } @@ -240,11 +233,11 @@ public: } } - T* get() const BOOST_SP_NOEXCEPT { + T* get() const noexcept { return result_; } - void release() BOOST_SP_NOEXCEPT { + void release() noexcept { result_ = 0; } @@ -259,7 +252,7 @@ private: } /* detail */ template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type allocate_shared(const A& allocator, std::size_t count) { typedef typename detail::sp_array_element<T>::type element; @@ -276,15 +269,15 @@ allocate_shared(const A& allocator, std::size_t count) } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type allocate_shared(const A& allocator) { enum { - count = extent<T>::value + count = std::extent<T>::value }; typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; - typedef detail::sp_size_array_state<other, extent<T>::value> state; + typedef detail::sp_size_array_state<other, std::extent<T>::value> state; typedef detail::sp_array_base<state> base; detail::sp_array_result<other, base> result(allocator, count); base* node = result.get(); @@ -296,9 +289,9 @@ allocate_shared(const A& allocator) } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type allocate_shared(const A& allocator, std::size_t count, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; @@ -314,16 +307,16 @@ allocate_shared(const A& allocator, std::size_t count, } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type allocate_shared(const A& allocator, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { enum { - count = extent<T>::value + count = std::extent<T>::value }; typedef typename detail::sp_array_element<T>::type element; typedef typename allocator_rebind<A, element>::type other; - typedef detail::sp_size_array_state<other, extent<T>::value> state; + typedef detail::sp_size_array_state<other, std::extent<T>::value> state; typedef detail::sp_array_base<state> base; detail::sp_array_result<other, base> result(allocator, count); base* node = result.get(); @@ -335,14 +328,14 @@ allocate_shared(const A& allocator, } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type allocate_shared_noinit(const A& allocator, std::size_t count) { return boost::allocate_shared<T>(boost::noinit_adapt(allocator), count); } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type allocate_shared_noinit(const A& allocator) { return boost::allocate_shared<T>(boost::noinit_adapt(allocator)); diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_unique.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_unique.hpp index 412b344230..969d547106 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_unique.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/allocate_unique.hpp @@ -8,43 +8,35 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP #define BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/core/allocator_access.hpp> #include <boost/core/alloc_construct.hpp> #include <boost/core/empty_value.hpp> #include <boost/core/first_scalar.hpp> #include <boost/core/noinit_adaptor.hpp> #include <boost/core/pointer_traits.hpp> -#include <boost/type_traits/enable_if.hpp> -#include <boost/type_traits/extent.hpp> -#include <boost/type_traits/is_array.hpp> -#include <boost/type_traits/is_bounded_array.hpp> -#include <boost/type_traits/is_unbounded_array.hpp> -#include <boost/type_traits/remove_cv.hpp> -#include <boost/type_traits/remove_extent.hpp> -#include <boost/type_traits/type_identity.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> #include <boost/config.hpp> #include <memory> #include <utility> +#include <cstddef> +#include <type_traits> namespace boost { namespace detail { template<class T> struct sp_alloc_size { - BOOST_STATIC_CONSTEXPR std::size_t value = 1; + static constexpr std::size_t value = 1; }; template<class T> struct sp_alloc_size<T[]> { - BOOST_STATIC_CONSTEXPR std::size_t value = sp_alloc_size<T>::value; + static constexpr std::size_t value = sp_alloc_size<T>::value; }; template<class T, std::size_t N> struct sp_alloc_size<T[N]> { - BOOST_STATIC_CONSTEXPR std::size_t value = N * sp_alloc_size<T>::value; + static constexpr std::size_t value = N * sp_alloc_size<T>::value; }; template<class T> @@ -59,8 +51,8 @@ struct sp_alloc_result<T[N]> { template<class T> struct sp_alloc_value { - typedef typename boost::remove_cv<typename - boost::remove_extent<T>::type>::type type; + typedef typename std::remove_cv<typename + std::remove_extent<T>::type>::type type; }; template<class T, class P> @@ -68,45 +60,41 @@ class sp_alloc_ptr { public: typedef T element_type; - sp_alloc_ptr() BOOST_SP_NOEXCEPT + sp_alloc_ptr() noexcept : p_() { } #if defined(BOOST_MSVC) && BOOST_MSVC == 1600 - sp_alloc_ptr(T* p) BOOST_SP_NOEXCEPT - : p_(const_cast<typename boost::remove_cv<T>::type*>(p)) { } + sp_alloc_ptr(T* p) noexcept + : p_(const_cast<typename std::remove_cv<T>::type*>(p)) { } #endif - sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::size_t, P p) noexcept : p_(p) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) noexcept : p_() { } -#endif T& operator*() const { return *p_; } - T* operator->() const BOOST_SP_NOEXCEPT { + T* operator->() const noexcept { return boost::to_address(p_); } -#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - explicit operator bool() const BOOST_SP_NOEXCEPT { + explicit operator bool() const noexcept { return !!p_; } -#endif - bool operator!() const BOOST_SP_NOEXCEPT { + bool operator!() const noexcept { return !p_; } - P ptr() const BOOST_SP_NOEXCEPT { + P ptr() const noexcept { return p_; } - BOOST_STATIC_CONSTEXPR std::size_t size() BOOST_SP_NOEXCEPT { + static constexpr std::size_t size() noexcept { return 1; } @@ -114,7 +102,7 @@ public: static sp_alloc_ptr pointer_to(T& v) { return sp_alloc_ptr(1, std::pointer_traits<P>::pointer_to(const_cast<typename - boost::remove_cv<T>::type&>(v))); + std::remove_cv<T>::type&>(v))); } #endif @@ -127,37 +115,33 @@ class sp_alloc_ptr<T[], P> { public: typedef T element_type; - sp_alloc_ptr() BOOST_SP_NOEXCEPT + sp_alloc_ptr() noexcept : p_() { } - sp_alloc_ptr(std::size_t n, P p) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::size_t n, P p) noexcept : p_(p) , n_(n) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) noexcept : p_() { } -#endif T& operator[](std::size_t i) const { return p_[i]; } -#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - explicit operator bool() const BOOST_SP_NOEXCEPT { + explicit operator bool() const noexcept { return !!p_; } -#endif - bool operator!() const BOOST_SP_NOEXCEPT { + bool operator!() const noexcept { return !p_; } - P ptr() const BOOST_SP_NOEXCEPT { + P ptr() const noexcept { return p_; } - std::size_t size() const BOOST_SP_NOEXCEPT { + std::size_t size() const noexcept { return n_; } @@ -165,7 +149,7 @@ public: static sp_alloc_ptr pointer_to(T& v) { return sp_alloc_ptr(n_, std::pointer_traits<P>::pointer_to(const_cast<typename - boost::remove_cv<T>::type&>(v))); + std::remove_cv<T>::type&>(v))); } #endif @@ -179,36 +163,32 @@ class sp_alloc_ptr<T[N], P> { public: typedef T element_type; - sp_alloc_ptr() BOOST_SP_NOEXCEPT + sp_alloc_ptr() noexcept : p_() { } - sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::size_t, P p) noexcept : p_(p) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) noexcept : p_() { } -#endif T& operator[](std::size_t i) const { return p_[i]; } -#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - explicit operator bool() const BOOST_SP_NOEXCEPT { + explicit operator bool() const noexcept { return !!p_; } -#endif - bool operator!() const BOOST_SP_NOEXCEPT { + bool operator!() const noexcept { return !p_; } - P ptr() const BOOST_SP_NOEXCEPT { + P ptr() const noexcept { return p_; } - BOOST_STATIC_CONSTEXPR std::size_t size() BOOST_SP_NOEXCEPT { + static constexpr std::size_t size() noexcept { return N; } @@ -216,7 +196,7 @@ public: static sp_alloc_ptr pointer_to(T& v) { return sp_alloc_ptr(N, std::pointer_traits<P>::pointer_to(const_cast<typename - boost::remove_cv<T>::type&>(v))); + std::remove_cv<T>::type&>(v))); } #endif @@ -238,19 +218,18 @@ operator!=(const sp_alloc_ptr<T, P>& lhs, const sp_alloc_ptr<T, P>& rhs) return !(lhs == rhs); } -#if !defined(BOOST_NO_CXX11_NULLPTR) template<class T, class P> inline bool operator==(const sp_alloc_ptr<T, P>& lhs, - detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + std::nullptr_t) noexcept { return !lhs.ptr(); } template<class T, class P> inline bool -operator==(detail::sp_nullptr_t, - const sp_alloc_ptr<T, P>& rhs) BOOST_SP_NOEXCEPT +operator==(std::nullptr_t, + const sp_alloc_ptr<T, P>& rhs) noexcept { return !rhs.ptr(); } @@ -258,24 +237,23 @@ operator==(detail::sp_nullptr_t, template<class T, class P> inline bool operator!=(const sp_alloc_ptr<T, P>& lhs, - detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + std::nullptr_t) noexcept { return !!lhs.ptr(); } template<class T, class P> inline bool -operator!=(detail::sp_nullptr_t, - const sp_alloc_ptr<T, P>& rhs) BOOST_SP_NOEXCEPT +operator!=(std::nullptr_t, + const sp_alloc_ptr<T, P>& rhs) noexcept { return !!rhs.ptr(); } -#endif template<class A> inline void sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p, std::size_t, - boost::false_type) + std::false_type) { boost::alloc_destroy(a, boost::to_address(p)); } @@ -283,7 +261,7 @@ sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p, std::size_t, template<class A> inline void sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p, - std::size_t n, boost::true_type) + std::size_t n, std::true_type) { #if defined(BOOST_MSVC) && BOOST_MSVC < 1800 if (!p) { @@ -308,19 +286,17 @@ public: typedef detail::sp_alloc_ptr<T, typename allocator_pointer<allocator>::type> pointer; - explicit alloc_deleter(const allocator& a) BOOST_SP_NOEXCEPT + explicit alloc_deleter(const allocator& a) noexcept : base(empty_init_t(), a) { } void operator()(pointer p) { - detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), is_array<T>()); + detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), std::is_array<T>()); base::get().deallocate(p.ptr(), p.size()); } }; -#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) template<class T, class A> using alloc_noinit_deleter = alloc_deleter<T, noinit_adaptor<A> >; -#endif namespace detail { @@ -347,15 +323,15 @@ public: } } - typename allocator::value_type* get() const BOOST_SP_NOEXCEPT { + typename allocator::value_type* get() const noexcept { return boost::to_address(p_); } - allocator& state() BOOST_SP_NOEXCEPT { + allocator& state() noexcept { return a_; } - type release() BOOST_SP_NOEXCEPT { + type release() noexcept { pointer p = p_; p_ = pointer(); return type(typename deleter::pointer(n_, p), deleter(a_)); @@ -372,7 +348,7 @@ private: } /* detail */ template<class T, class A> -inline typename enable_if_<!is_array<T>::value, +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc) { @@ -381,9 +357,8 @@ allocate_unique(const A& alloc) return c.release(); } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template<class T, class A, class... Args> -inline typename enable_if_<!is_array<T>::value, +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc, Args&&... args) { @@ -391,12 +366,11 @@ allocate_unique(const A& alloc, Args&&... args) boost::alloc_construct(c.state(), c.get(), std::forward<Args>(args)...); return c.release(); } -#endif template<class T, class A> -inline typename enable_if_<!is_array<T>::value, +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T, alloc_deleter<T, A> > >::type -allocate_unique(const A& alloc, typename type_identity<T>::type&& value) +allocate_unique(const A& alloc, typename detail::sp_type_identity<T>::type&& value) { detail::sp_alloc_make<T, A> c(alloc, 1); boost::alloc_construct(c.state(), c.get(), std::move(value)); @@ -404,7 +378,7 @@ allocate_unique(const A& alloc, typename type_identity<T>::type&& value) } template<class T, class A> -inline typename enable_if_<!is_array<T>::value, +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type allocate_unique_noinit(const A& alloc) { @@ -412,7 +386,7 @@ allocate_unique_noinit(const A& alloc) } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, std::unique_ptr<T, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc, std::size_t size) { @@ -423,19 +397,19 @@ allocate_unique(const A& alloc, std::size_t size) } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, std::unique_ptr<typename detail::sp_alloc_result<T>::type, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc) { - detail::sp_alloc_make<T, A> c(alloc, extent<T>::value); + detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value); boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()), detail::sp_alloc_size<T>::value); return c.release(); } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type allocate_unique_noinit(const A& alloc, std::size_t size) { @@ -443,7 +417,7 @@ allocate_unique_noinit(const A& alloc, std::size_t size) } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, std::unique_ptr<typename detail::sp_alloc_result<T>::type, alloc_deleter<T, noinit_adaptor<A> > > >::type allocate_unique_noinit(const A& alloc) @@ -452,29 +426,29 @@ allocate_unique_noinit(const A& alloc) } template<class T, class A> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, std::unique_ptr<T, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc, std::size_t size, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { detail::sp_alloc_make<T, A> c(alloc, size); boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()), size * detail::sp_alloc_size<T>::value, boost::first_scalar(&value), - detail::sp_alloc_size<typename remove_extent<T>::type>::value); + detail::sp_alloc_size<typename std::remove_extent<T>::type>::value); return c.release(); } template<class T, class A> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, std::unique_ptr<typename detail::sp_alloc_result<T>::type, alloc_deleter<T, A> > >::type allocate_unique(const A& alloc, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { - detail::sp_alloc_make<T, A> c(alloc, extent<T>::value); + detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value); boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()), detail::sp_alloc_size<T>::value, boost::first_scalar(&value), - detail::sp_alloc_size<typename remove_extent<T>::type>::value); + detail::sp_alloc_size<typename std::remove_extent<T>::type>::value); return c.release(); } @@ -482,7 +456,7 @@ template<class T, class U, class A> inline typename allocator_pointer<typename allocator_rebind<A, typename detail::sp_alloc_value<T>::type>::type>::type get_allocator_pointer(const std::unique_ptr<T, - alloc_deleter<U, A> >& p) BOOST_NOEXCEPT + alloc_deleter<U, A> >& p) noexcept { return p.get().ptr(); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/atomic_shared_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/atomic_shared_ptr.hpp index d855e5a877..2be0b64cca 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/atomic_shared_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/atomic_shared_ptr.hpp @@ -13,7 +13,6 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/shared_ptr.hpp> #include <boost/smart_ptr/detail/spinlock.hpp> #include <cstring> @@ -34,7 +33,7 @@ private: private: - bool compare_exchange( shared_ptr<T>& v, shared_ptr<T> w ) BOOST_SP_NOEXCEPT + bool compare_exchange( shared_ptr<T>& v, shared_ptr<T> w ) noexcept { l_.lock(); @@ -58,39 +57,16 @@ private: public: -#if !defined( BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX ) && !defined( BOOST_NO_CXX11_CONSTEXPR ) - - constexpr atomic_shared_ptr() BOOST_SP_NOEXCEPT: l_ BOOST_DETAIL_SPINLOCK_INIT + constexpr atomic_shared_ptr() noexcept: l_ BOOST_DETAIL_SPINLOCK_INIT { } - atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT + atomic_shared_ptr( shared_ptr<T> p ) noexcept : p_( std::move( p ) ), l_ BOOST_DETAIL_SPINLOCK_INIT { } -#else - - atomic_shared_ptr() BOOST_SP_NOEXCEPT - { - boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT; - std::memcpy( &l_, &init, sizeof( init ) ); - } - - atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - : p_( std::move( p ) ) -#else - : p_( p ) -#endif - { - boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT; - std::memcpy( &l_, &init, sizeof( init ) ); - } - -#endif - - atomic_shared_ptr& operator=( shared_ptr<T> r ) BOOST_SP_NOEXCEPT + atomic_shared_ptr& operator=( shared_ptr<T> r ) noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); p_.swap( r ); @@ -98,140 +74,120 @@ public: return *this; } - BOOST_CONSTEXPR bool is_lock_free() const BOOST_SP_NOEXCEPT + constexpr bool is_lock_free() const noexcept { return false; } - shared_ptr<T> load() const BOOST_SP_NOEXCEPT + shared_ptr<T> load() const noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); return p_; } - template<class M> shared_ptr<T> load( M ) const BOOST_SP_NOEXCEPT + template<class M> shared_ptr<T> load( M ) const noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); return p_; } - operator shared_ptr<T>() const BOOST_SP_NOEXCEPT + operator shared_ptr<T>() const noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); return p_; } - void store( shared_ptr<T> r ) BOOST_SP_NOEXCEPT + void store( shared_ptr<T> r ) noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); p_.swap( r ); } - template<class M> void store( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT + template<class M> void store( shared_ptr<T> r, M ) noexcept { boost::detail::spinlock::scoped_lock lock( l_ ); p_.swap( r ); } - shared_ptr<T> exchange( shared_ptr<T> r ) BOOST_SP_NOEXCEPT + shared_ptr<T> exchange( shared_ptr<T> r ) noexcept { { boost::detail::spinlock::scoped_lock lock( l_ ); p_.swap( r ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - return std::move( r ); - -#else - - return r; - -#endif } - template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT + template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) noexcept { { boost::detail::spinlock::scoped_lock lock( l_ ); p_.swap( r ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - return std::move( r ); - -#else - - return r; - -#endif } - template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) noexcept { return compare_exchange( v, w ); } - template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) noexcept { return compare_exchange( v, w ); } - bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT + bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) noexcept { return compare_exchange( v, w ); } - template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) noexcept { return compare_exchange( v, w ); } - template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M ) noexcept { return compare_exchange( v, w ); } - bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT + bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) noexcept { return compare_exchange( v, w ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) noexcept { return compare_exchange( v, std::move( w ) ); } - template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) noexcept { return compare_exchange( v, std::move( w ) ); } - bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT + bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) noexcept { return compare_exchange( v, std::move( w ) ); } - template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) noexcept { return compare_exchange( v, std::move( w ) ); } - template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT + template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M ) noexcept { return compare_exchange( v, std::move( w ) ); } - bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT + bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) noexcept { return compare_exchange( v, std::move( w ) ); } - -#endif }; } // namespace boost diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/bad_weak_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/bad_weak_ptr.hpp index d8edd04c93..b0cc510939 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/bad_weak_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/bad_weak_ptr.hpp @@ -20,23 +20,9 @@ #include <boost/config.hpp> #include <exception> -#ifdef BOOST_BORLANDC -# pragma warn -8026 // Functions with excep. spec. are not expanded inline -#endif - namespace boost { -// The standard library that comes with Borland C++ 5.5.1, 5.6.4 -// defines std::exception and its members as having C calling -// convention (-pc). When the definition of bad_weak_ptr -// is compiled with -ps, the compiler issues an error. -// Hence, the temporary #pragma option -pc below. - -#if defined(BOOST_BORLANDC) && BOOST_BORLANDC <= 0x564 -# pragma option push -pc -#endif - #if defined(BOOST_CLANG) // Intel C++ on Mac defines __clang__ but doesn't support the pragma # pragma clang diagnostic push @@ -47,7 +33,7 @@ class bad_weak_ptr: public std::exception { public: - char const * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE + char const * what() const noexcept override { return "tr1::bad_weak_ptr"; } @@ -57,14 +43,6 @@ public: # pragma clang diagnostic pop #endif -#if defined(BOOST_BORLANDC) && BOOST_BORLANDC <= 0x564 -# pragma option pop -#endif - } // namespace boost -#ifdef BOOST_BORLANDC -# pragma warn .8026 // Functions with excep. spec. are not expanded inline -#endif - #endif // #ifndef BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/atomic_count.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/atomic_count.hpp index 749b3f08a1..0ed3cb3281 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/atomic_count.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/atomic_count.hpp @@ -45,6 +45,7 @@ #include <boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp> #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> #include <boost/config.hpp> #if defined( BOOST_AC_DISABLE_THREADS ) diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/deprecated_macros.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/deprecated_macros.hpp new file mode 100644 index 0000000000..7f5786d8a7 --- /dev/null +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/deprecated_macros.hpp @@ -0,0 +1,52 @@ +#ifndef BOOST_SMART_PTR_DETAIL_DEPRECATED_MACROS_HPP_INCLUDED +#define BOOST_SMART_PTR_DETAIL_DEPRECATED_MACROS_HPP_INCLUDED + +// Copyright 2024 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include <boost/config/pragma_message.hpp> + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_SP_ENABLE_DEBUG_HOOKS has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_SP_USE_STD_ALLOCATOR) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_SP_USE_STD_ALLOCATOR has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_SP_USE_QUICK_ALLOCATOR has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_AC_USE_SPINLOCK) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_AC_USE_SPINLOCK has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_AC_USE_PTHREADS) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_AC_USE_PTHREADS has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_SP_USE_SPINLOCK) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_SP_USE_SPINLOCK has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#if defined(BOOST_SP_USE_PTHREADS) + +BOOST_PRAGMA_MESSAGE("The macro BOOST_SP_USE_PTHREADS has been deprecated in 1.87 and support for it will be removed.") + +#endif + +#endif // #ifndef BOOST_SMART_PTR_DETAIL_DEPRECATED_MACROS_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/lightweight_thread.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/lightweight_thread.hpp index 867f00b0b7..e14efedef6 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/lightweight_thread.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/lightweight_thread.hpp @@ -106,16 +106,8 @@ public: extern "C" void * lw_thread_routine( void * pv ) { -#if defined(BOOST_NO_CXX11_SMART_PTR) - - std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) ); - -#else - std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) ); -#endif - pt->run(); return 0; @@ -125,16 +117,8 @@ extern "C" void * lw_thread_routine( void * pv ) unsigned __stdcall lw_thread_routine( void * pv ) { -#if defined(BOOST_NO_CXX11_SMART_PTR) - - std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) ); - -#else - std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) ); -#endif - pt->run(); return 0; @@ -162,16 +146,8 @@ private: template<class F> int lw_thread_create( lw_thread_t & th, F f ) { -#if defined(BOOST_NO_CXX11_SMART_PTR) - - std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) ); - -#else - std::unique_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) ); -#endif - int r = lw_thread_create_( &th, 0, lw_thread_routine, p.get() ); if( r == 0 ) diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_counted_base.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_counted_base.hpp index f730419849..ec644860b2 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_counted_base.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_counted_base.hpp @@ -42,23 +42,23 @@ private: public: - BOOST_CONSTEXPR local_counted_base() BOOST_SP_NOEXCEPT: local_use_count_( initial_ ) + constexpr local_counted_base() noexcept: local_use_count_( initial_ ) { } - BOOST_CONSTEXPR local_counted_base( local_counted_base const & ) BOOST_SP_NOEXCEPT: local_use_count_( initial_ ) + constexpr local_counted_base( local_counted_base const & ) noexcept: local_use_count_( initial_ ) { } - virtual ~local_counted_base() /*BOOST_SP_NOEXCEPT*/ + virtual ~local_counted_base() /*noexcept*/ { } - virtual void local_cb_destroy() BOOST_SP_NOEXCEPT = 0; + virtual void local_cb_destroy() noexcept = 0; - virtual boost::detail::shared_count local_cb_get_shared_count() const BOOST_SP_NOEXCEPT = 0; + virtual boost::detail::shared_count local_cb_get_shared_count() const noexcept = 0; - void add_ref() BOOST_SP_NOEXCEPT + void add_ref() noexcept { #if !defined(__NVCC__) #if defined( __has_builtin ) @@ -73,7 +73,7 @@ public: local_use_count_ = static_cast<count_type>( local_use_count_ + 1 ); } - void release() BOOST_SP_NOEXCEPT + void release() noexcept { local_use_count_ = static_cast<count_type>( local_use_count_ - 1 ); @@ -83,7 +83,7 @@ public: } } - long local_use_count() const BOOST_SP_NOEXCEPT + long local_use_count() const noexcept { return local_use_count_; } @@ -101,24 +101,20 @@ private: public: - explicit local_counted_impl( shared_count const& pn ) BOOST_SP_NOEXCEPT: pn_( pn ) + explicit local_counted_impl( shared_count const& pn ) noexcept: pn_( pn ) { } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - explicit local_counted_impl( shared_count && pn ) BOOST_SP_NOEXCEPT: pn_( std::move(pn) ) + explicit local_counted_impl( shared_count && pn ) noexcept: pn_( std::move(pn) ) { } -#endif - - void local_cb_destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void local_cb_destroy() noexcept override { delete this; } - boost::detail::shared_count local_cb_get_shared_count() const BOOST_SP_NOEXCEPT BOOST_OVERRIDE + boost::detail::shared_count local_cb_get_shared_count() const noexcept override { return pn_; } @@ -130,12 +126,12 @@ public: shared_count pn_; - void local_cb_destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void local_cb_destroy() noexcept override { shared_count().swap( pn_ ); } - boost::detail::shared_count local_cb_get_shared_count() const BOOST_SP_NOEXCEPT BOOST_OVERRIDE + boost::detail::shared_count local_cb_get_shared_count() const noexcept override { return pn_; } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_sp_deleter.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_sp_deleter.hpp index 9ede7e36cc..af3743dff0 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_sp_deleter.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/local_sp_deleter.hpp @@ -38,48 +38,40 @@ public: { } - explicit local_sp_deleter( D const& d ) BOOST_SP_NOEXCEPT: d_( d ) + explicit local_sp_deleter( D const& d ) noexcept: d_( d ) { } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - explicit local_sp_deleter( D&& d ) BOOST_SP_NOEXCEPT: d_( std::move(d) ) + explicit local_sp_deleter( D&& d ) noexcept: d_( std::move(d) ) { } -#endif - - D& deleter() BOOST_SP_NOEXCEPT + D& deleter() noexcept { return d_; } - template<class Y> void operator()( Y* p ) BOOST_SP_NOEXCEPT + template<class Y> void operator()( Y* p ) noexcept { d_( p ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - void operator()( boost::detail::sp_nullptr_t p ) BOOST_SP_NOEXCEPT + void operator()( std::nullptr_t p ) noexcept { d_( p ); } - -#endif }; template<> class local_sp_deleter<void> { }; -template<class D> D * get_local_deleter( local_sp_deleter<D> * p ) BOOST_SP_NOEXCEPT +template<class D> D * get_local_deleter( local_sp_deleter<D> * p ) noexcept { return &p->deleter(); } -inline void * get_local_deleter( local_sp_deleter<void> * /*p*/ ) BOOST_SP_NOEXCEPT +inline void * get_local_deleter( local_sp_deleter<void> * /*p*/ ) noexcept { return 0; } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/operator_bool.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/operator_bool.hpp deleted file mode 100644 index f9c5ef6803..0000000000 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/operator_bool.hpp +++ /dev/null @@ -1,64 +0,0 @@ -// This header intentionally has no include guards. -// -// Copyright (c) 2001-2009, 2012 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 - -#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR )\ - && !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5130)) - - explicit operator bool () const BOOST_SP_NOEXCEPT - { - return px != 0; - } - -#elif ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570) ) || defined(__CINT__) - - operator bool () const BOOST_SP_NOEXCEPT - { - return px != 0; - } - -#elif defined( _MANAGED ) - - static void unspecified_bool( this_type*** ) - { - } - - typedef void (*unspecified_bool_type)( this_type*** ); - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: unspecified_bool; - } - -#elif \ - ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \ - ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) || \ - ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) ) - - typedef element_type * (this_type::*unspecified_bool_type)() const; - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: &this_type::get; - } - -#else - - typedef element_type * this_type::*unspecified_bool_type; - - operator unspecified_bool_type() const BOOST_SP_NOEXCEPT - { - return px == 0? 0: &this_type::px; - } - -#endif - - // operator! is redundant, but some compilers need it - bool operator! () const BOOST_SP_NOEXCEPT - { - return px == 0; - } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/quick_allocator.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/quick_allocator.hpp index 159bd5e7aa..8ec6dfa309 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/quick_allocator.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/quick_allocator.hpp @@ -21,21 +21,20 @@ #include <boost/config.hpp> #include <boost/smart_ptr/detail/lightweight_mutex.hpp> -#include <boost/type_traits/type_with_alignment.hpp> -#include <boost/type_traits/alignment_of.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <type_traits> #include <new> // ::operator new, ::operator delete #include <cstddef> // std::size_t namespace boost { - namespace detail { template<unsigned size, unsigned align_> union freeblock { - typedef typename boost::type_with_alignment<align_>::type aligner_type; + typedef typename sp_type_with_alignment<align_>::type aligner_type; aligner_type aligner; char bytes[size]; freeblock * next; @@ -74,7 +73,7 @@ template<unsigned size, unsigned align_> struct allocator_impl static lightweight_mutex & mutex() { - static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm; + static freeblock< sizeof( lightweight_mutex ), std::alignment_of< lightweight_mutex >::value > fbm; static lightweight_mutex * pm = new( &fbm ) lightweight_mutex; return *pm; } @@ -188,7 +187,7 @@ template<unsigned size, unsigned align_> unsigned allocator_impl<size, align_>::last = allocator_impl<size, align_>::items_per_page; template<class T> -struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of<T>::value > +struct quick_allocator: public allocator_impl< sizeof(T), std::alignment_of<T>::value > { }; diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/requires_cxx11.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/requires_cxx11.hpp deleted file mode 100644 index f1ed5f6b4e..0000000000 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/requires_cxx11.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED -#define BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include <boost/config.hpp> -#include <boost/config/pragma_message.hpp> - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ - defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_DECLTYPE) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_NULLPTR) || \ - defined(BOOST_NO_CXX11_SMART_PTR) - -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.87.") - -#endif - -#endif // #ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/shared_count.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/shared_count.hpp index c6fe1bb2d1..cafd3c2fe5 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/shared_count.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/shared_count.hpp @@ -18,15 +18,11 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#if defined(__BORLANDC__) && !defined(__clang__) -# pragma warn -8027 // Functions containing try are not expanded inline -#endif - #include <boost/smart_ptr/bad_weak_ptr.hpp> #include <boost/smart_ptr/detail/sp_counted_base.hpp> #include <boost/smart_ptr/detail/sp_counted_impl.hpp> #include <boost/smart_ptr/detail/sp_disable_deprecated.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> #include <boost/core/checked_delete.hpp> #include <boost/throw_exception.hpp> #include <boost/core/addressof.hpp> @@ -100,7 +96,7 @@ template< class D > struct sp_convert_reference< D& > typedef sp_reference_wrapper< D > type; }; -template<class T> std::size_t sp_hash_pointer( T* p ) BOOST_NOEXCEPT +template<class T> std::size_t sp_hash_pointer( T* p ) noexcept { boost::uintptr_t v = reinterpret_cast<boost::uintptr_t>( p ); @@ -124,14 +120,14 @@ private: public: - BOOST_CONSTEXPR shared_count() BOOST_SP_NOEXCEPT: pi_(0) + constexpr shared_count() noexcept: pi_(0) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { } - BOOST_CONSTEXPR explicit shared_count( sp_counted_base * pi ) BOOST_SP_NOEXCEPT: pi_( pi ) + constexpr explicit shared_count( sp_counted_base * pi ) noexcept: pi_( pi ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif @@ -168,18 +164,11 @@ public: #endif } -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) - template<class Y, class D> shared_count( Y * p, D d ): pi_(0) -#else template<class P, class D> shared_count( P p, D d ): pi_(0) -#endif #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif { -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) - typedef Y* P; -#endif #ifndef BOOST_NO_EXCEPTIONS try @@ -205,8 +194,6 @@ public: #endif } -#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) - template< class P, class D > shared_count( P p, sp_inplace_tag<D> ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) @@ -237,8 +224,6 @@ public: #endif // #ifndef BOOST_NO_EXCEPTIONS } -#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) - template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) @@ -246,16 +231,8 @@ public: { typedef sp_counted_impl_pda<P, D, A> impl_type; -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2; -#else - - typedef typename A::template rebind< impl_type >::other A2; - -#endif - A2 a2( a ); #ifndef BOOST_NO_EXCEPTIONS @@ -294,8 +271,6 @@ public: #endif } -#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) - template< class P, class D, class A > shared_count( P p, sp_inplace_tag< D >, A a ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) @@ -303,16 +278,8 @@ public: { typedef sp_counted_impl_pda< P, D, A > impl_type; -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2; -#else - - typedef typename A::template rebind< impl_type >::other A2; - -#endif - A2 a2( a ); #ifndef BOOST_NO_EXCEPTIONS @@ -351,8 +318,6 @@ public: #endif // #ifndef BOOST_NO_EXCEPTIONS } -#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) - #ifndef BOOST_NO_AUTO_PTR // auto_ptr<Y> is special cased to provide the strong guarantee @@ -377,8 +342,6 @@ public: #endif -#if !defined( BOOST_NO_CXX11_SMART_PTR ) - template<class Y, class D> explicit shared_count( std::unique_ptr<Y, D> & r ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) @@ -402,8 +365,6 @@ public: r.release(); } -#endif - template<class Y, class D> explicit shared_count( boost::movelib::unique_ptr<Y, D> & r ): pi_( 0 ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) @@ -427,7 +388,7 @@ public: r.release(); } - ~shared_count() /*BOOST_SP_NOEXCEPT*/ + ~shared_count() /*noexcept*/ { if( pi_ != 0 ) pi_->release(); #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) @@ -435,7 +396,7 @@ public: #endif } - shared_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_) + shared_count(shared_count const & r) noexcept: pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif @@ -443,9 +404,7 @@ public: if( pi_ != 0 ) pi_->add_ref_copy(); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - shared_count(shared_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_) + shared_count(shared_count && r) noexcept: pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif @@ -453,12 +412,10 @@ public: r.pi_ = 0; } -#endif - explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0 - shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT; // constructs an empty *this when r.use_count() == 0 + shared_count( weak_count const & r, sp_nothrow_tag ) noexcept; // constructs an empty *this when r.use_count() == 0 - shared_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT + shared_count & operator= (shared_count const & r) noexcept { sp_counted_base * tmp = r.pi_; @@ -472,58 +429,58 @@ public: return *this; } - void swap(shared_count & r) BOOST_SP_NOEXCEPT + void swap(shared_count & r) noexcept { sp_counted_base * tmp = r.pi_; r.pi_ = pi_; pi_ = tmp; } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pi_ != 0? pi_->use_count(): 0; } - bool unique() const BOOST_SP_NOEXCEPT + bool unique() const noexcept { return use_count() == 1; } - bool empty() const BOOST_SP_NOEXCEPT + bool empty() const noexcept { return pi_ == 0; } - bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT + bool operator==( shared_count const & r ) const noexcept { return pi_ == r.pi_; } - bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT; + bool operator==( weak_count const & r ) const noexcept; - bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT + bool operator<( shared_count const & r ) const noexcept { return std::less<sp_counted_base *>()( pi_, r.pi_ ); } - bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT; + bool operator<( weak_count const & r ) const noexcept; - void * get_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * get_deleter( sp_typeinfo_ const & ti ) const noexcept { return pi_? pi_->get_deleter( ti ): 0; } - void * get_local_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * get_local_deleter( sp_typeinfo_ const & ti ) const noexcept { return pi_? pi_->get_local_deleter( ti ): 0; } - void * get_untyped_deleter() const BOOST_SP_NOEXCEPT + void * get_untyped_deleter() const noexcept { return pi_? pi_->get_untyped_deleter(): 0; } - std::size_t hash_value() const BOOST_SP_NOEXCEPT + std::size_t hash_value() const noexcept { return sp_hash_pointer( pi_ ); } @@ -544,14 +501,14 @@ private: public: - BOOST_CONSTEXPR weak_count() BOOST_SP_NOEXCEPT: pi_(0) + constexpr weak_count() noexcept: pi_(0) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(weak_count_id) #endif { } - weak_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_) + weak_count(shared_count const & r) noexcept: pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(weak_count_id) #endif @@ -559,7 +516,7 @@ public: if(pi_ != 0) pi_->weak_add_ref(); } - weak_count(weak_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_) + weak_count(weak_count const & r) noexcept: pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(weak_count_id) #endif @@ -569,9 +526,7 @@ public: // Move support -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - weak_count(weak_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_) + weak_count(weak_count && r) noexcept: pi_(r.pi_) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(weak_count_id) #endif @@ -579,9 +534,7 @@ public: r.pi_ = 0; } -#endif - - ~weak_count() /*BOOST_SP_NOEXCEPT*/ + ~weak_count() /*noexcept*/ { if(pi_ != 0) pi_->weak_release(); #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) @@ -589,7 +542,7 @@ public: #endif } - weak_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT + weak_count & operator= (shared_count const & r) noexcept { sp_counted_base * tmp = r.pi_; @@ -603,7 +556,7 @@ public: return *this; } - weak_count & operator= (weak_count const & r) BOOST_SP_NOEXCEPT + weak_count & operator= (weak_count const & r) noexcept { sp_counted_base * tmp = r.pi_; @@ -617,44 +570,44 @@ public: return *this; } - void swap(weak_count & r) BOOST_SP_NOEXCEPT + void swap(weak_count & r) noexcept { sp_counted_base * tmp = r.pi_; r.pi_ = pi_; pi_ = tmp; } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pi_ != 0? pi_->use_count(): 0; } - bool empty() const BOOST_SP_NOEXCEPT + bool empty() const noexcept { return pi_ == 0; } - bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT + bool operator==( weak_count const & r ) const noexcept { return pi_ == r.pi_; } - bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT + bool operator==( shared_count const & r ) const noexcept { return pi_ == r.pi_; } - bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT + bool operator<( weak_count const & r ) const noexcept { return std::less<sp_counted_base *>()( pi_, r.pi_ ); } - bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT + bool operator<( shared_count const & r ) const noexcept { return std::less<sp_counted_base *>()( pi_, r.pi_ ); } - std::size_t hash_value() const BOOST_SP_NOEXCEPT + std::size_t hash_value() const noexcept { return sp_hash_pointer( pi_ ); } @@ -671,7 +624,7 @@ inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ ) } } -inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT: pi_( r.pi_ ) +inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) noexcept: pi_( r.pi_ ) #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) , id_(shared_count_id) #endif @@ -682,12 +635,12 @@ inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_ } } -inline bool shared_count::operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT +inline bool shared_count::operator==( weak_count const & r ) const noexcept { return pi_ == r.pi_; } -inline bool shared_count::operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT +inline bool shared_count::operator<( weak_count const & r ) const noexcept { return std::less<sp_counted_base *>()( pi_, r.pi_ ); } @@ -700,8 +653,4 @@ inline bool shared_count::operator<( weak_count const & r ) const BOOST_SP_NOEXC #pragma GCC diagnostic pop #endif -#if defined(__BORLANDC__) && !defined(__clang__) -# pragma warn .8027 // Functions containing try are not expanded inline -#endif - #endif // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_convertible.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_convertible.hpp index af422883ce..c60f69fae0 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_convertible.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_convertible.hpp @@ -18,20 +18,6 @@ #include <boost/config.hpp> #include <cstddef> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_BORLANDC ) && ( BOOST_BORLANDC < 0x630 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - namespace boost { @@ -87,6 +73,4 @@ template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_i } // namespace boost -#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base.hpp index 536926a580..d670083352 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base.hpp @@ -19,6 +19,7 @@ #include <boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp> #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> #include <boost/config.hpp> #if defined( BOOST_SP_DISABLE_THREADS ) diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp index eb37a79439..04b7a6a1db 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_nt.hpp @@ -19,7 +19,6 @@ // #include <boost/smart_ptr/detail/sp_typeinfo_.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <boost/config.hpp> #include <boost/cstdint.hpp> @@ -48,43 +47,43 @@ private: public: - sp_counted_base() BOOST_SP_NOEXCEPT: use_count_( 1 ), weak_count_( 1 ) + sp_counted_base() noexcept: use_count_( 1 ), weak_count_( 1 ) { } - virtual ~sp_counted_base() /*BOOST_SP_NOEXCEPT*/ + virtual ~sp_counted_base() /*noexcept*/ { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. - virtual void dispose() BOOST_SP_NOEXCEPT = 0; // nothrow + virtual void dispose() noexcept = 0; // nothrow // destroy() is called when weak_count_ drops to zero. - virtual void destroy() BOOST_SP_NOEXCEPT // nothrow + virtual void destroy() noexcept // nothrow { delete this; } - virtual void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0; - virtual void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0; - virtual void * get_untyped_deleter() BOOST_SP_NOEXCEPT = 0; + virtual void * get_deleter( sp_typeinfo_ const & ti ) noexcept = 0; + virtual void * get_local_deleter( sp_typeinfo_ const & ti ) noexcept = 0; + virtual void * get_untyped_deleter() noexcept = 0; - void add_ref_copy() BOOST_SP_NOEXCEPT + void add_ref_copy() noexcept { ++use_count_; } - bool add_ref_lock() BOOST_SP_NOEXCEPT // true on success + bool add_ref_lock() noexcept // true on success { if( use_count_ == 0 ) return false; ++use_count_; return true; } - void release() BOOST_SP_NOEXCEPT + void release() noexcept { if( --use_count_ == 0 ) { @@ -93,12 +92,12 @@ public: } } - void weak_add_ref() BOOST_SP_NOEXCEPT + void weak_add_ref() noexcept { ++weak_count_; } - void weak_release() BOOST_SP_NOEXCEPT + void weak_release() noexcept { if( --weak_count_ == 0 ) { @@ -106,7 +105,7 @@ public: } } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return use_count_; } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp index 52acf92b94..7237f1e0f2 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp @@ -16,7 +16,6 @@ // http://www.boost.org/LICENSE_1_0.txt #include <boost/smart_ptr/detail/sp_typeinfo_.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <boost/config.hpp> #include <atomic> #include <cstdint> @@ -34,17 +33,17 @@ namespace boost namespace detail { -inline void atomic_increment( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT +inline void atomic_increment( std::atomic_int_least32_t * pw ) noexcept { pw->fetch_add( 1, std::memory_order_relaxed ); } -inline std::int_least32_t atomic_decrement( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT +inline std::int_least32_t atomic_decrement( std::atomic_int_least32_t * pw ) noexcept { return pw->fetch_sub( 1, std::memory_order_acq_rel ); } -inline std::int_least32_t atomic_conditional_increment( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT +inline std::int_least32_t atomic_conditional_increment( std::atomic_int_least32_t * pw ) noexcept { // long r = *pw; // if( r != 0 ) ++*pw; @@ -78,41 +77,41 @@ private: public: - sp_counted_base() BOOST_SP_NOEXCEPT: use_count_( 1 ), weak_count_( 1 ) + sp_counted_base() noexcept: use_count_( 1 ), weak_count_( 1 ) { } - virtual ~sp_counted_base() /*BOOST_SP_NOEXCEPT*/ + virtual ~sp_counted_base() /*noexcept*/ { } // dispose() is called when use_count_ drops to zero, to release // the resources managed by *this. - virtual void dispose() BOOST_SP_NOEXCEPT = 0; + virtual void dispose() noexcept = 0; // destroy() is called when weak_count_ drops to zero. - virtual void destroy() BOOST_SP_NOEXCEPT + virtual void destroy() noexcept { delete this; } - virtual void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0; - virtual void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0; - virtual void * get_untyped_deleter() BOOST_SP_NOEXCEPT = 0; + virtual void * get_deleter( sp_typeinfo_ const & ti ) noexcept = 0; + virtual void * get_local_deleter( sp_typeinfo_ const & ti ) noexcept = 0; + virtual void * get_untyped_deleter() noexcept = 0; - void add_ref_copy() BOOST_SP_NOEXCEPT + void add_ref_copy() noexcept { atomic_increment( &use_count_ ); } - bool add_ref_lock() BOOST_SP_NOEXCEPT // true on success + bool add_ref_lock() noexcept // true on success { return atomic_conditional_increment( &use_count_ ) != 0; } - void release() BOOST_SP_NOEXCEPT + void release() noexcept { if( atomic_decrement( &use_count_ ) == 1 ) { @@ -121,12 +120,12 @@ public: } } - void weak_add_ref() BOOST_SP_NOEXCEPT + void weak_add_ref() noexcept { atomic_increment( &weak_count_ ); } - void weak_release() BOOST_SP_NOEXCEPT + void weak_release() noexcept { if( atomic_decrement( &weak_count_ ) == 1 ) { @@ -134,7 +133,7 @@ public: } } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return use_count_.load( std::memory_order_acquire ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp index dc0df4acb6..0fe034115e 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_base_w32.hpp @@ -90,18 +90,7 @@ public: long tmp = static_cast< long const volatile& >( use_count_ ); if( tmp == 0 ) return false; -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1200 ) - - // work around a code generation bug - - long tmp2 = tmp + 1; - if( BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true; - -#else - if( BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true; - -#endif } } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_impl.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_impl.hpp index 8c12ac908e..828e758ead 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_impl.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_counted_impl.hpp @@ -23,7 +23,7 @@ #endif #include <boost/smart_ptr/detail/sp_counted_base.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> #include <boost/core/checked_delete.hpp> #include <boost/core/addressof.hpp> #include <boost/config.hpp> @@ -52,12 +52,12 @@ namespace detail template<class D> class local_sp_deleter; -template<class D> D * get_local_deleter( D * /*p*/ ) BOOST_SP_NOEXCEPT +template<class D> D * get_local_deleter( D * /*p*/ ) noexcept { return 0; } -template<class D> D * get_local_deleter( local_sp_deleter<D> * p ) BOOST_SP_NOEXCEPT; +template<class D> D * get_local_deleter( local_sp_deleter<D> * p ) noexcept; // @@ -81,7 +81,7 @@ public: #endif } - void dispose() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void dispose() noexcept override { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_destructor_hook( px_, sizeof(X), this ); @@ -89,17 +89,17 @@ public: boost::checked_delete( px_ ); } - void * get_deleter( sp_typeinfo_ const & ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_deleter( sp_typeinfo_ const & ) noexcept override { return 0; } - void * get_local_deleter( sp_typeinfo_ const & ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_local_deleter( sp_typeinfo_ const & ) noexcept override { return 0; } - void * get_untyped_deleter() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_untyped_deleter() noexcept override { return 0; } @@ -133,13 +133,6 @@ public: #endif }; -// -// Borland's Codeguard trips up over the -Vx- option here: -// -#ifdef __CODEGUARD__ -# pragma option push -Vx- -#endif - template<class P, class D> class BOOST_SYMBOL_VISIBLE sp_counted_impl_pd: public sp_counted_base { private: @@ -156,40 +149,30 @@ public: // pre: d(p) must not throw -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - sp_counted_impl_pd( P p, D & d ): ptr( p ), del( static_cast< D&& >( d ) ) { } -#else - - sp_counted_impl_pd( P p, D & d ): ptr( p ), del( d ) - { - } - -#endif - sp_counted_impl_pd( P p ): ptr( p ), del() { } - void dispose() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void dispose() noexcept override { del( ptr ); } - void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_deleter( sp_typeinfo_ const & ti ) noexcept override { return ti == BOOST_SP_TYPEID_(D)? &reinterpret_cast<char&>( del ): 0; } - void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_local_deleter( sp_typeinfo_ const & ti ) noexcept override { return ti == BOOST_SP_TYPEID_(D)? boost::detail::get_local_deleter( boost::addressof( del ) ): 0; } - void * get_untyped_deleter() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_untyped_deleter() noexcept override { return &reinterpret_cast<char&>( del ); } @@ -240,41 +223,23 @@ public: // pre: d( p ) must not throw -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( static_cast< D&& >( d ) ), a_( a ) { } -#else - - sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( d ), a_( a ) - { - } - -#endif - sp_counted_impl_pda( P p, A a ): p_( p ), d_( a ), a_( a ) { } - void dispose() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void dispose() noexcept override { d_( p_ ); } - void destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void destroy() noexcept override { -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc< this_type > A2; -#else - - typedef typename A::template rebind< this_type >::other A2; - -#endif - A2 a2( a_ ); this->~this_type(); @@ -282,26 +247,22 @@ public: a2.deallocate( this, 1 ); } - void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_deleter( sp_typeinfo_ const & ti ) noexcept override { return ti == BOOST_SP_TYPEID_( D )? &reinterpret_cast<char&>( d_ ): 0; } - void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_local_deleter( sp_typeinfo_ const & ti ) noexcept override { return ti == BOOST_SP_TYPEID_( D )? boost::detail::get_local_deleter( boost::addressof( d_ ) ): 0; } - void * get_untyped_deleter() BOOST_SP_NOEXCEPT BOOST_OVERRIDE + void * get_untyped_deleter() noexcept override { return &reinterpret_cast<char&>( d_ ); } }; -#ifdef __CODEGUARD__ -# pragma option pop -#endif - } // namespace detail } // namespace boost diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_forward.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_forward.hpp deleted file mode 100644 index 8fdec65b7f..0000000000 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_forward.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED -#define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_forward.hpp -// -// Copyright 2008,2012 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 - -#include <boost/config.hpp> - -namespace boost -{ - -namespace detail -{ - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -#if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404 - -// GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object. -// This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward. -template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT -{ - return t; -} - -#else - -template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT -{ - return static_cast< T&& >( t ); -} - -#endif - -#endif - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_noexcept.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_noexcept.hpp index 1287ba4952..3b0d04ed50 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_noexcept.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_noexcept.hpp @@ -15,25 +15,16 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include <boost/config.hpp> -// BOOST_SP_NOEXCEPT +// BOOST_SP_NOEXCEPT (obsolete, only retained for compatibility) -#if defined( BOOST_MSVC ) && BOOST_MSVC >= 1700 && BOOST_MSVC < 1900 +#define BOOST_SP_NOEXCEPT noexcept -# define BOOST_SP_NOEXCEPT BOOST_NOEXCEPT_OR_NOTHROW - -#else - -# define BOOST_SP_NOEXCEPT BOOST_NOEXCEPT - -#endif - -// BOOST_SP_NOEXCEPT_WITH_ASSERT +// BOOST_SP_NOEXCEPT_WITH_ASSERT (noexcept, unless a user assertion handler is present) #if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) ) -# define BOOST_SP_NOEXCEPT_WITH_ASSERT BOOST_SP_NOEXCEPT +# define BOOST_SP_NOEXCEPT_WITH_ASSERT noexcept #elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) ) @@ -41,7 +32,7 @@ #else -# define BOOST_SP_NOEXCEPT_WITH_ASSERT BOOST_SP_NOEXCEPT +# define BOOST_SP_NOEXCEPT_WITH_ASSERT noexcept #endif diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_nullptr_t.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_nullptr_t.hpp deleted file mode 100644 index 219ae8070a..0000000000 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_nullptr_t.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED -#define BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_nullptr_t.hpp -// -// Copyright 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 - -#include <boost/config.hpp> -#include <cstddef> - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -namespace boost -{ - -namespace detail -{ - -#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) - - typedef decltype(nullptr) sp_nullptr_t; - -#else - - typedef std::nullptr_t sp_nullptr_t; - -#endif - -} // namespace detail - -} // namespace boost - -#endif // !defined( BOOST_NO_CXX11_NULLPTR ) - -#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_type_traits.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_type_traits.hpp new file mode 100644 index 0000000000..a717f92ff0 --- /dev/null +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/sp_type_traits.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED +#define BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED + +// Copyright 2024 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include <type_traits> + +namespace boost +{ +namespace detail +{ + +// std::is_bounded_array (C++20) + +template<class T> struct sp_is_bounded_array: std::false_type +{ +}; + +template<class T, std::size_t N> struct sp_is_bounded_array< T[N] >: std::true_type +{ +}; + +// std::is_unbounded_array (C++20) + +template<class T> struct sp_is_unbounded_array: std::false_type +{ +}; + +template<class T> struct sp_is_unbounded_array< T[] >: std::true_type +{ +}; + +// std::type_identity (C++20) + +template<class T> struct sp_type_identity +{ + typedef T type; +}; + +// boost::type_with_alignment + +template<std::size_t A> struct sp_type_with_alignment +{ + struct alignas(A) type + { + unsigned char padding[ A ]; + }; +}; + +} // namespace detail +} // namespace boost + +#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock.hpp index 26e1b081e3..1c90becfe1 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock.hpp @@ -30,6 +30,7 @@ #include <boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp> #include <boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> #include <boost/config.hpp> #if defined( BOOST_SP_USE_STD_ATOMIC ) diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp index 458370c505..013ce4e021 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp @@ -16,7 +16,6 @@ // #include <boost/smart_ptr/detail/yield_k.hpp> -#include <boost/config.hpp> #include <atomic> #if defined(BOOST_SP_REPORT_IMPLEMENTATION) @@ -40,12 +39,12 @@ public: public: - bool try_lock() BOOST_NOEXCEPT + bool try_lock() noexcept { return !v_.test_and_set( std::memory_order_acquire ); } - void lock() BOOST_NOEXCEPT + void lock() noexcept { for( unsigned k = 0; !try_lock(); ++k ) { @@ -53,7 +52,7 @@ public: } } - void unlock() BOOST_NOEXCEPT + void unlock() noexcept { v_ .clear( std::memory_order_release ); } @@ -71,12 +70,12 @@ public: public: - explicit scoped_lock( spinlock & sp ) BOOST_NOEXCEPT: sp_( sp ) + explicit scoped_lock( spinlock & sp ) noexcept: sp_( sp ) { sp.lock(); } - ~scoped_lock() /*BOOST_NOEXCEPT*/ + ~scoped_lock() /*noexcept*/ { sp_.unlock(); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from.hpp index 68fb8e42a2..66212d7023 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from.hpp @@ -11,9 +11,7 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/enable_shared_from_this.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> namespace boost { @@ -32,7 +30,7 @@ template<class T> shared_ptr<T> shared_from( T * p ) return shared_ptr<T>( p->enable_shared_from_this<enable_shared_from>::shared_from_this(), p ); } -template<class T> weak_ptr<T> weak_from( T * p ) BOOST_SP_NOEXCEPT +template<class T> weak_ptr<T> weak_from( T * p ) noexcept { return weak_ptr<T>( p->enable_shared_from_this<enable_shared_from>::weak_from_this(), p ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_raw.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_raw.hpp index 3b2da3e7dd..50e86d0339 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_raw.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_raw.hpp @@ -71,15 +71,12 @@ private: } } -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -public: -#else private: + template<class Y> friend class shared_ptr; template<typename T> friend boost::shared_ptr<T> shared_from_raw(T *); template<typename T> friend boost::weak_ptr<T> weak_from_raw(T *); template< class X, class Y > friend inline void detail::sp_enable_shared_from_this( boost::shared_ptr<X> * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); -#endif shared_ptr<void const volatile> shared_from_this() const { diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_this.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_this.hpp index b4ea23cf8a..0c2b3f9343 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_this.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/enable_shared_from_this.hpp @@ -13,12 +13,9 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/weak_ptr.hpp> #include <boost/smart_ptr/shared_ptr.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <boost/assert.hpp> -#include <boost/config.hpp> namespace boost { @@ -27,20 +24,20 @@ template<class T> class enable_shared_from_this { protected: - BOOST_CONSTEXPR enable_shared_from_this() BOOST_SP_NOEXCEPT + constexpr enable_shared_from_this() noexcept { } - BOOST_CONSTEXPR enable_shared_from_this(enable_shared_from_this const &) BOOST_SP_NOEXCEPT + constexpr enable_shared_from_this(enable_shared_from_this const &) noexcept { } - enable_shared_from_this & operator=(enable_shared_from_this const &) BOOST_SP_NOEXCEPT + enable_shared_from_this & operator=(enable_shared_from_this const &) noexcept { return *this; } - ~enable_shared_from_this() BOOST_SP_NOEXCEPT // ~weak_ptr<T> newer throws, so this call also must not throw + ~enable_shared_from_this() noexcept // ~weak_ptr<T> newer throws, so this call also must not throw { } @@ -60,12 +57,12 @@ public: return p; } - weak_ptr<T> weak_from_this() BOOST_SP_NOEXCEPT + weak_ptr<T> weak_from_this() noexcept { return weak_this_; } - weak_ptr<T const> weak_from_this() const BOOST_SP_NOEXCEPT + weak_ptr<T const> weak_from_this() const noexcept { return weak_this_; } @@ -73,7 +70,7 @@ public: public: // actually private, but avoids compiler template friendship issues // Note: invoked automatically by shared_ptr; do not call - template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const BOOST_SP_NOEXCEPT + template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const noexcept { if( weak_this_.expired() ) { diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ptr.hpp index a0a325ea73..ddb20c0b0e 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ptr.hpp @@ -13,26 +13,13 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> - -#include <boost/config.hpp> - -#include <boost/assert.hpp> -#include <boost/config/workaround.hpp> #include <boost/smart_ptr/detail/sp_convertible.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/assert.hpp> -#include <boost/config/no_tr1/functional.hpp> // for std::less - -#if !defined(BOOST_NO_IOSTREAM) -#if !defined(BOOST_NO_IOSFWD) +#include <functional> // for std::less #include <iosfwd> // for std::basic_ostream -#else -#include <ostream> -#endif -#endif - +#include <cstddef> namespace boost { @@ -62,7 +49,7 @@ public: typedef T element_type; - BOOST_CONSTEXPR intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 ) + constexpr intrusive_ptr() noexcept : px( 0 ) { } @@ -71,25 +58,13 @@ public: if( px != 0 && add_ref ) intrusive_ptr_add_ref( px ); } -#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) - template<class U> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() ) - -#else - - intrusive_ptr( intrusive_ptr<U> const & rhs ) - -#endif : px( rhs.get() ) { if( px != 0 ) intrusive_ptr_add_ref( px ); } -#endif - intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px ) { if( px != 0 ) intrusive_ptr_add_ref( px ); @@ -100,26 +75,20 @@ public: if( px != 0 ) intrusive_ptr_release( px ); } -#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) - template<class U> intrusive_ptr & operator=(intrusive_ptr<U> const & rhs) { this_type(rhs).swap(*this); return *this; } -#endif - // Move support -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px ) + intrusive_ptr(intrusive_ptr && rhs) noexcept : px( rhs.px ) { rhs.px = 0; } - intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT + intrusive_ptr & operator=(intrusive_ptr && rhs) noexcept { this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); return *this; @@ -128,29 +97,19 @@ public: template<class U> friend class intrusive_ptr; template<class U> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - intrusive_ptr(intrusive_ptr<U> && rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty()) - -#else - - intrusive_ptr(intrusive_ptr<U> && rhs) - -#endif : px( rhs.px ) { rhs.px = 0; } template<class U> - intrusive_ptr & operator=(intrusive_ptr<U> && rhs) BOOST_SP_NOEXCEPT + intrusive_ptr & operator=(intrusive_ptr<U> && rhs) noexcept { this_type( static_cast< intrusive_ptr<U> && >( rhs ) ).swap(*this); return *this; } -#endif - intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); @@ -178,12 +137,12 @@ public: this_type( rhs, add_ref ).swap( *this ); } - T * get() const BOOST_SP_NOEXCEPT + T * get() const noexcept { return px; } - T * detach() BOOST_SP_NOEXCEPT + T * detach() noexcept { T * ret = px; px = 0; @@ -202,10 +161,12 @@ public: return px; } -// implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT + void swap(intrusive_ptr & rhs) noexcept { T * tmp = px; px = rhs.px; @@ -217,73 +178,69 @@ private: T * px; }; -template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept { return a.get() == b.get(); } -template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept { return a.get() != b.get(); } -template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b) noexcept { return a.get() == b; } -template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b) noexcept { return a.get() != b; } -template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b) noexcept { return a == b.get(); } -template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b) noexcept { return a != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( intrusive_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, intrusive_ptr<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( intrusive_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, intrusive_ptr<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT +template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) noexcept { return std::less<T *>()(a.get(), b.get()); } -template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs) BOOST_SP_NOEXCEPT +template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs) noexcept { lhs.swap(rhs); } // mem_fn support -template<class T> T * get_pointer(intrusive_ptr<T> const & p) BOOST_SP_NOEXCEPT +template<class T> T * get_pointer(intrusive_ptr<T> const & p) noexcept { return p.get(); } @@ -305,19 +262,17 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U return dynamic_cast<T *>(p.get()); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -template<class T, class U> intrusive_ptr<T> static_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT +template<class T, class U> intrusive_ptr<T> static_pointer_cast( intrusive_ptr<U> && p ) noexcept { return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false ); } -template<class T, class U> intrusive_ptr<T> const_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT +template<class T, class U> intrusive_ptr<T> const_pointer_cast( intrusive_ptr<U> && p ) noexcept { return intrusive_ptr<T>( const_cast<T*>( p.detach() ), false ); } -template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT +template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<U> && p ) noexcept { T * p2 = dynamic_cast<T*>( p.get() ); @@ -328,48 +283,19 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr< return r; } -#endif // defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // operator<< -#if !defined(BOOST_NO_IOSTREAM) - -#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) ) - template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p) { os << p.get(); return os; } -#else - -// in STLport's no-iostreams mode no iostream symbols can be used -#ifndef _STLP_NO_IOSTREAMS - -# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) -// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL -using std::basic_ostream; -template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p) -# else -template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, intrusive_ptr<Y> const & p) -# endif -{ - os << p.get(); - return os; -} - -#endif // _STLP_NO_IOSTREAMS - -#endif // __GNUC__ < 3 - -#endif // !defined(BOOST_NO_IOSTREAM) - // hash_value template< class T > struct hash; -template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) noexcept { return boost::hash< T* >()( p.get() ); } @@ -378,14 +304,12 @@ template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) // std::hash -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - namespace std { template<class T> struct hash< ::boost::intrusive_ptr<T> > { - std::size_t operator()( ::boost::intrusive_ptr<T> const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::boost::intrusive_ptr<T> const & p ) const noexcept { return std::hash< T* >()( p.get() ); } @@ -393,6 +317,4 @@ template<class T> struct hash< ::boost::intrusive_ptr<T> > } // namespace std -#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - #endif // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ref_counter.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ref_counter.hpp index c2f918d0a4..6419376607 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ref_counter.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/intrusive_ref_counter.hpp @@ -15,9 +15,8 @@ #ifndef BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_ #define BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_ -#include <boost/config.hpp> #include <boost/smart_ptr/detail/atomic_count.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/config.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once @@ -46,17 +45,17 @@ struct thread_unsafe_counter { typedef unsigned int type; - static unsigned int load(unsigned int const& counter) BOOST_SP_NOEXCEPT + static unsigned int load(unsigned int const& counter) noexcept { return counter; } - static void increment(unsigned int& counter) BOOST_SP_NOEXCEPT + static void increment(unsigned int& counter) noexcept { ++counter; } - static unsigned int decrement(unsigned int& counter) BOOST_SP_NOEXCEPT + static unsigned int decrement(unsigned int& counter) noexcept { return --counter; } @@ -72,17 +71,17 @@ struct thread_safe_counter { typedef boost::detail::atomic_count type; - static unsigned int load(boost::detail::atomic_count const& counter) BOOST_SP_NOEXCEPT + static unsigned int load(boost::detail::atomic_count const& counter) noexcept { return static_cast< unsigned int >(static_cast< long >(counter)); } - static void increment(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT + static void increment(boost::detail::atomic_count& counter) noexcept { ++counter; } - static unsigned int decrement(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT + static unsigned int decrement(boost::detail::atomic_count& counter) noexcept { return static_cast< unsigned int >(--counter); } @@ -92,9 +91,9 @@ template< typename DerivedT, typename CounterPolicyT = thread_safe_counter > class intrusive_ref_counter; template< typename DerivedT, typename CounterPolicyT > -void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT; +void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept; template< typename DerivedT, typename CounterPolicyT > -void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT; +void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept; /*! * \brief A reference counter base class @@ -122,7 +121,7 @@ public: * * \post <tt>use_count() == 0</tt> */ - intrusive_ref_counter() BOOST_SP_NOEXCEPT : m_ref_counter(0) + intrusive_ref_counter() noexcept : m_ref_counter(0) { } @@ -131,7 +130,7 @@ public: * * \post <tt>use_count() == 0</tt> */ - intrusive_ref_counter(intrusive_ref_counter const&) BOOST_SP_NOEXCEPT : m_ref_counter(0) + intrusive_ref_counter(intrusive_ref_counter const&) noexcept : m_ref_counter(0) { } @@ -140,12 +139,12 @@ public: * * \post The reference counter is not modified after assignment */ - intrusive_ref_counter& operator= (intrusive_ref_counter const&) BOOST_SP_NOEXCEPT { return *this; } + intrusive_ref_counter& operator= (intrusive_ref_counter const&) noexcept { return *this; } /*! * \return The reference counter */ - unsigned int use_count() const BOOST_SP_NOEXCEPT + unsigned int use_count() const noexcept { return CounterPolicyT::load(m_ref_counter); } @@ -156,18 +155,18 @@ protected: */ BOOST_DEFAULTED_FUNCTION(~intrusive_ref_counter(), {}) - friend void intrusive_ptr_add_ref< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT; - friend void intrusive_ptr_release< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT; + friend void intrusive_ptr_add_ref< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept; + friend void intrusive_ptr_release< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept; }; template< typename DerivedT, typename CounterPolicyT > -inline void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT +inline void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept { CounterPolicyT::increment(p->m_ref_counter); } template< typename DerivedT, typename CounterPolicyT > -inline void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT +inline void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept { if (CounterPolicyT::decrement(p->m_ref_counter) == 0) delete static_cast< const DerivedT* >(p); diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/local_shared_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/local_shared_ptr.hpp index 19051dfd6f..5fac9c2a01 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/local_shared_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/local_shared_ptr.hpp @@ -11,8 +11,9 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/shared_ptr.hpp> +#include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/assert.hpp> namespace boost { @@ -127,7 +128,7 @@ public: // destructor - ~local_shared_ptr() BOOST_SP_NOEXCEPT + ~local_shared_ptr() noexcept { if( pn ) { @@ -137,20 +138,16 @@ public: // constructors - BOOST_CONSTEXPR local_shared_ptr() BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 ) + constexpr local_shared_ptr() noexcept : px( 0 ), pn( 0 ) { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - BOOST_CONSTEXPR local_shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 ) + constexpr local_shared_ptr( std::nullptr_t ) noexcept : px( 0 ), pn( 0 ) { } -#endif - // internal constructor, used by make_shared - BOOST_CONSTEXPR local_shared_ptr( boost::detail::lsp_internal_constructor_tag, element_type * px_, boost::detail::local_counted_base * pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ ) + constexpr local_shared_ptr( boost::detail::lsp_internal_constructor_tag, element_type * px_, boost::detail::local_counted_base * pn_ ) noexcept : px( px_ ), pn( pn_ ) { } @@ -165,29 +162,21 @@ public: boost::detail::lsp_deleter_construct( this, p, d, pn ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - template<class D> local_shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( 0 ) + template<class D> local_shared_ptr( std::nullptr_t p, D d ): px( p ), pn( 0 ) { boost::detail::lsp_deleter_construct( this, p, d, pn ); } -#endif - template<class Y, class D, class A> local_shared_ptr( Y * p, D d, A a ): px( p ), pn( 0 ) { boost::detail::lsp_allocator_construct( this, p, d, a, pn ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - template<class D, class A> local_shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( 0 ) + template<class D, class A> local_shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( 0 ) { boost::detail::lsp_allocator_construct( this, p, d, a, pn ); } -#endif - // construction from shared_ptr template<class Y> local_shared_ptr( shared_ptr<Y> const & r, @@ -202,8 +191,6 @@ public: } } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> local_shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) : px( r.get() ), pn( 0 ) @@ -217,12 +204,8 @@ public: } } -#endif - // construction from unique_ptr -#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template< class Y, class D > local_shared_ptr( std::unique_ptr< Y, D > && r, typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) @@ -236,8 +219,6 @@ public: } } -#endif - template< class Y, class D > local_shared_ptr( boost::movelib::unique_ptr< Y, D > r ); // ! // : px( r.get() ), pn( new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) ) ) ) @@ -247,7 +228,7 @@ public: // copy constructor - local_shared_ptr( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + local_shared_ptr( local_shared_ptr const & r ) noexcept : px( r.px ), pn( r.pn ) { if( pn ) { @@ -257,20 +238,16 @@ public: // move constructor -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - local_shared_ptr( local_shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + local_shared_ptr( local_shared_ptr && r ) noexcept : px( r.px ), pn( r.pn ) { r.px = 0; r.pn = 0; } -#endif - // converting copy constructor template<class Y> local_shared_ptr( local_shared_ptr<Y> const & r, - typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT + typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y, T >(); @@ -283,10 +260,8 @@ public: // converting move constructor -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> local_shared_ptr( local_shared_ptr<Y> && r, - typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT + typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y, T >(); @@ -295,12 +270,10 @@ public: r.pn = 0; } -#endif - // aliasing template<class Y> - local_shared_ptr( local_shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) + local_shared_ptr( local_shared_ptr<Y> const & r, element_type * p ) noexcept : px( p ), pn( r.pn ) { if( pn ) { @@ -308,60 +281,46 @@ public: } } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> - local_shared_ptr( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) + local_shared_ptr( local_shared_ptr<Y> && r, element_type * p ) noexcept : px( p ), pn( r.pn ) { r.px = 0; r.pn = 0; } -#endif - // assignment - local_shared_ptr & operator=( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT + local_shared_ptr & operator=( local_shared_ptr const & r ) noexcept { local_shared_ptr( r ).swap( *this ); return *this; } - template<class Y> local_shared_ptr & operator=( local_shared_ptr<Y> const & r ) BOOST_SP_NOEXCEPT + template<class Y> local_shared_ptr & operator=( local_shared_ptr<Y> const & r ) noexcept { local_shared_ptr( r ).swap( *this ); return *this; } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - local_shared_ptr & operator=( local_shared_ptr && r ) BOOST_SP_NOEXCEPT + local_shared_ptr & operator=( local_shared_ptr && r ) noexcept { local_shared_ptr( std::move( r ) ).swap( *this ); return *this; } template<class Y> - local_shared_ptr & operator=( local_shared_ptr<Y> && r ) BOOST_SP_NOEXCEPT + local_shared_ptr & operator=( local_shared_ptr<Y> && r ) noexcept { local_shared_ptr( std::move( r ) ).swap( *this ); return *this; } -#endif - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - local_shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT + local_shared_ptr & operator=( std::nullptr_t ) noexcept { local_shared_ptr().swap(*this); return *this; } -#endif - -#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y, class D> local_shared_ptr & operator=( std::unique_ptr<Y, D> && r ) { @@ -369,14 +328,12 @@ public: return *this; } -#endif - template<class Y, class D> local_shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r ); // ! // reset - void reset() BOOST_SP_NOEXCEPT + void reset() noexcept { local_shared_ptr().swap( *this ); } @@ -396,28 +353,24 @@ public: local_shared_ptr( p, d, a ).swap( *this ); } - template<class Y> void reset( local_shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT + template<class Y> void reset( local_shared_ptr<Y> const & r, element_type * p ) noexcept { local_shared_ptr( r, p ).swap( *this ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class Y> void reset( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT + template<class Y> void reset( local_shared_ptr<Y> && r, element_type * p ) noexcept { local_shared_ptr( std::move( r ), p ).swap( *this ); } -#endif - // accessors - typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT + typename boost::detail::sp_dereference< T >::type operator* () const noexcept { return *px; } - typename boost::detail::sp_member_access< T >::type operator-> () const BOOST_SP_NOEXCEPT + typename boost::detail::sp_member_access< T >::type operator-> () const noexcept { return px; } @@ -430,26 +383,24 @@ public: return static_cast< typename boost::detail::sp_array_access< T >::type >( px[ i ] ); } - element_type * get() const BOOST_SP_NOEXCEPT + element_type * get() const noexcept { return px; } - // implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - long local_use_count() const BOOST_SP_NOEXCEPT + long local_use_count() const noexcept { return pn? pn->local_use_count(): 0; } // conversions to shared_ptr, weak_ptr -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) - template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT -#else - template<class Y> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT -#endif + template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator shared_ptr<Y>() const noexcept { boost::detail::sp_assert_convertible<T, Y>(); @@ -463,11 +414,7 @@ public: } } -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) - template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT -#else - template<class Y> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT -#endif + template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator weak_ptr<Y>() const noexcept { boost::detail::sp_assert_convertible<T, Y>(); @@ -483,7 +430,7 @@ public: // swap - void swap( local_shared_ptr & r ) BOOST_SP_NOEXCEPT + void swap( local_shared_ptr & r ) noexcept { std::swap( px, r.px ); std::swap( pn, r.pn ); @@ -491,84 +438,80 @@ public: // owner_before - template<class Y> bool owner_before( local_shared_ptr<Y> const & r ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_before( local_shared_ptr<Y> const & r ) const noexcept { return std::less< boost::detail::local_counted_base* >()( pn, r.pn ); } // owner_equals - template<class Y> bool owner_equals( local_shared_ptr<Y> const & r ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_equals( local_shared_ptr<Y> const & r ) const noexcept { return pn == r.pn; } }; -template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) noexcept { return a.get() == b.get(); } -template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, local_shared_ptr<U> const & b ) noexcept { return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( local_shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( local_shared_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, local_shared_ptr<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( local_shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( local_shared_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, local_shared_ptr<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) noexcept { return a.get() == b.get(); } -template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=( local_shared_ptr<T> const & a, shared_ptr<U> const & b ) noexcept { return a.get() != b.get(); } -template<class T, class U> inline bool operator==( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) noexcept { return a.get() == b.get(); } -template<class T, class U> inline bool operator!=( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=( shared_ptr<T> const & a, local_shared_ptr<U> const & b ) noexcept { return a.get() != b.get(); } -template<class T, class U> inline bool operator<(local_shared_ptr<T> const & a, local_shared_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator<(local_shared_ptr<T> const & a, local_shared_ptr<U> const & b) noexcept { return a.owner_before( b ); } -template<class T> inline void swap( local_shared_ptr<T> & a, local_shared_ptr<T> & b ) BOOST_SP_NOEXCEPT +template<class T> inline void swap( local_shared_ptr<T> & a, local_shared_ptr<T> & b ) noexcept { a.swap( b ); } -template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> const & r ) noexcept { (void) static_cast< T* >( static_cast< U* >( 0 ) ); @@ -578,7 +521,7 @@ template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared return local_shared_ptr<T>( r, p ); } -template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> const & r ) noexcept { (void) const_cast< T* >( static_cast< U* >( 0 ) ); @@ -588,7 +531,7 @@ template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ return local_shared_ptr<T>( r, p ); } -template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> const & r ) noexcept { (void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); @@ -598,7 +541,7 @@ template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_share return p? local_shared_ptr<T>( r, p ): local_shared_ptr<T>(); } -template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> const & r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -608,9 +551,7 @@ template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_s return local_shared_ptr<T>( r, p ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> && r ) noexcept { (void) static_cast< T* >( static_cast< U* >( 0 ) ); @@ -620,7 +561,7 @@ template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared return local_shared_ptr<T>( std::move(r), p ); } -template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ptr<U> && r ) noexcept { (void) const_cast< T* >( static_cast< U* >( 0 ) ); @@ -630,7 +571,7 @@ template<class T, class U> local_shared_ptr<T> const_pointer_cast( local_shared_ return local_shared_ptr<T>( std::move(r), p ); } -template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_shared_ptr<U> && r ) noexcept { (void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); @@ -640,7 +581,7 @@ template<class T, class U> local_shared_ptr<T> dynamic_pointer_cast( local_share return p? local_shared_ptr<T>( std::move(r), p ): local_shared_ptr<T>(); } -template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_shared_ptr<U> && r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -650,30 +591,24 @@ template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_s return local_shared_ptr<T>( std::move(r), p ); } -#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // get_pointer() enables boost::mem_fn to recognize local_shared_ptr -template<class T> inline typename local_shared_ptr<T>::element_type * get_pointer( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline typename local_shared_ptr<T>::element_type * get_pointer( local_shared_ptr<T> const & p ) noexcept { return p.get(); } // operator<< -#if !defined(BOOST_NO_IOSTREAM) - template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< ( std::basic_ostream<E, T> & os, local_shared_ptr<Y> const & p ) { os << p.get(); return os; } -#endif // !defined(BOOST_NO_IOSTREAM) - // get_deleter -template<class D, class T> D * get_deleter( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class D, class T> D * get_deleter( local_shared_ptr<T> const & p ) noexcept { return get_deleter<D>( shared_ptr<T>( p ) ); } @@ -682,7 +617,7 @@ template<class D, class T> D * get_deleter( local_shared_ptr<T> const & p ) BOOS template< class T > struct hash; -template< class T > std::size_t hash_value( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( local_shared_ptr<T> const & p ) noexcept { return boost::hash< typename local_shared_ptr<T>::element_type* >()( p.get() ); } @@ -691,14 +626,12 @@ template< class T > std::size_t hash_value( local_shared_ptr<T> const & p ) BOOS // std::hash -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - namespace std { template<class T> struct hash< ::boost::local_shared_ptr<T> > { - std::size_t operator()( ::boost::local_shared_ptr<T> const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::boost::local_shared_ptr<T> const & p ) const noexcept { return std::hash< typename ::boost::local_shared_ptr<T>::element_type* >()( p.get() ); } @@ -706,6 +639,4 @@ template<class T> struct hash< ::boost::local_shared_ptr<T> > } // namespace std -#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - #endif // #ifndef BOOST_SMART_PTR_LOCAL_SHARED_PTR_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared.hpp index 2ad55a7df9..23114fea26 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared.hpp @@ -11,7 +11,6 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/make_local_shared_object.hpp> #include <boost/smart_ptr/make_local_shared_array.hpp> diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_array.hpp index 6caf78abcd..e9089fd4cf 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_array.hpp @@ -9,14 +9,15 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/core/default_allocator.hpp> #include <boost/smart_ptr/allocate_local_shared_array.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <type_traits> namespace boost { template<class T> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type make_local_shared() { @@ -25,16 +26,16 @@ make_local_shared() } template<class T> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type -make_local_shared(const typename remove_extent<T>::type& value) +make_local_shared(const typename std::remove_extent<T>::type& value) { return boost::allocate_local_shared<T>(boost::default_allocator<typename detail::sp_array_element<T>::type>(), value); } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type make_local_shared(std::size_t size) { @@ -43,17 +44,17 @@ make_local_shared(std::size_t size) } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type make_local_shared(std::size_t size, - const typename remove_extent<T>::type& value) + const typename std::remove_extent<T>::type& value) { return boost::allocate_local_shared<T>(boost::default_allocator<typename detail::sp_array_element<T>::type>(), size, value); } template<class T> -inline typename enable_if_<is_bounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, local_shared_ptr<T> >::type make_local_shared_noinit() { @@ -62,7 +63,7 @@ make_local_shared_noinit() } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, local_shared_ptr<T> >::type make_local_shared_noinit(std::size_t size) { diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_object.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_object.hpp index 2226688515..21a582c67e 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_object.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_local_shared_object.hpp @@ -11,11 +11,10 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/local_shared_ptr.hpp> #include <boost/smart_ptr/make_shared.hpp> -#include <boost/type_traits/remove_const.hpp> #include <boost/config.hpp> +#include <type_traits> #include <utility> #include <cstddef> @@ -46,7 +45,7 @@ template<class T, class A> class lsp_ms_deleter: public local_counted_impl_em { private: - typedef typename sp_aligned_storage<sizeof(T), ::boost::alignment_of<T>::value>::type storage_type; + typedef typename sp_aligned_storage<sizeof(T), std::alignment_of<T>::value>::type storage_type; storage_type storage_; A a_; @@ -54,57 +53,49 @@ private: private: - void destroy() BOOST_SP_NOEXCEPT + void destroy() noexcept { if( initialized_ ) { T * p = reinterpret_cast< T* >( storage_.data_ ); -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - std::allocator_traits<A>::destroy( a_, p ); -#else - - p->~T(); - -#endif - initialized_ = false; } } public: - explicit lsp_ms_deleter( A const & a ) BOOST_SP_NOEXCEPT : a_( a ), initialized_( false ) + explicit lsp_ms_deleter( A const & a ) noexcept : a_( a ), initialized_( false ) { } // optimization: do not copy storage_ - lsp_ms_deleter( lsp_ms_deleter const & r ) BOOST_SP_NOEXCEPT : a_( r.a_), initialized_( false ) + lsp_ms_deleter( lsp_ms_deleter const & r ) noexcept : a_( r.a_), initialized_( false ) { } - ~lsp_ms_deleter() BOOST_SP_NOEXCEPT + ~lsp_ms_deleter() noexcept { destroy(); } - void operator()( T * ) BOOST_SP_NOEXCEPT + void operator()( T * ) noexcept { destroy(); } - static void operator_fn( T* ) BOOST_SP_NOEXCEPT // operator() can't be static + static void operator_fn( T* ) noexcept // operator() can't be static { } - void * address() BOOST_SP_NOEXCEPT + void * address() noexcept { return storage_.data_; } - void set_initialized() BOOST_SP_NOEXCEPT + void set_initialized() noexcept { initialized_ = true; } @@ -114,16 +105,8 @@ public: template<class T, class A, class... Args> typename boost::detail::lsp_if_not_array<T>::type allocate_local_shared( A const & a, Args&&... args ) { -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc<T> A2; -#else - - typedef typename A::template rebind<T>::other A2; - -#endif - A2 a2( a ); typedef boost::detail::lsp_ms_deleter<T, A2> D; @@ -133,16 +116,8 @@ template<class T, class A, class... Args> typename boost::detail::lsp_if_not_arr D * pd = static_cast< D* >( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - std::allocator_traits<A2>::construct( a2, static_cast< T* >( pv ), std::forward<Args>( args )... ); -#else - - ::new( pv ) T( std::forward<Args>( args )... ); - -#endif - pd->set_initialized(); T * pt2 = static_cast< T* >( pv ); @@ -155,16 +130,8 @@ template<class T, class A, class... Args> typename boost::detail::lsp_if_not_arr template<class T, class A> typename boost::detail::lsp_if_not_array<T>::type allocate_local_shared_noinit( A const & a ) { -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc<T> A2; -#else - - typedef typename A::template rebind<T>::other A2; - -#endif - A2 a2( a ); typedef boost::detail::lsp_ms_deleter< T, std::allocator<T> > D; @@ -188,13 +155,13 @@ template<class T, class A> typename boost::detail::lsp_if_not_array<T>::type all template<class T, class... Args> typename boost::detail::lsp_if_not_array<T>::type make_local_shared( Args&&... args ) { - typedef typename boost::remove_const<T>::type T2; + typedef typename std::remove_const<T>::type T2; return boost::allocate_local_shared<T2>( std::allocator<T2>(), std::forward<Args>(args)... ); } template<class T> typename boost::detail::lsp_if_not_array<T>::type make_local_shared_noinit() { - typedef typename boost::remove_const<T>::type T2; + typedef typename std::remove_const<T>::type T2; return boost::allocate_shared_noinit<T2>( std::allocator<T2>() ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared.hpp index fd2261bc5a..1fdf6d6159 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared.hpp @@ -11,12 +11,8 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/make_shared_object.hpp> - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE ) -# include <boost/smart_ptr/make_shared_array.hpp> -# include <boost/smart_ptr/allocate_shared_array.hpp> -#endif +#include <boost/smart_ptr/make_shared_array.hpp> +#include <boost/smart_ptr/allocate_shared_array.hpp> #endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_array.hpp index 10dfdaa1b8..a0aa62b894 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_array.hpp @@ -8,14 +8,15 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/core/default_allocator.hpp> #include <boost/smart_ptr/allocate_shared_array.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <type_traits> namespace boost { template<class T> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type make_shared() { return boost::allocate_shared<T>(boost::default_allocator<typename @@ -23,15 +24,15 @@ make_shared() } template<class T> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type -make_shared(const typename remove_extent<T>::type& value) +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type +make_shared(const typename std::remove_extent<T>::type& value) { return boost::allocate_shared<T>(boost::default_allocator<typename detail::sp_array_element<T>::type>(), value); } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type make_shared(std::size_t size) { return boost::allocate_shared<T>(boost::default_allocator<typename @@ -39,15 +40,15 @@ make_shared(std::size_t size) } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type -make_shared(std::size_t size, const typename remove_extent<T>::type& value) +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type +make_shared(std::size_t size, const typename std::remove_extent<T>::type& value) { return boost::allocate_shared<T>(boost::default_allocator<typename detail::sp_array_element<T>::type>(), size, value); } template<class T> -inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type make_shared_noinit() { return boost::allocate_shared_noinit<T>(boost::default_allocator<typename @@ -55,7 +56,7 @@ make_shared_noinit() } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type make_shared_noinit(std::size_t size) { return boost::allocate_shared_noinit<T>(boost::default_allocator<typename diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_object.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_object.hpp index 12a7bac109..cc68ce34df 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_object.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_shared_object.hpp @@ -11,21 +11,16 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> -#include <boost/config.hpp> -#include <boost/move/core.hpp> -#include <boost/move/utility_core.hpp> #include <boost/smart_ptr/shared_ptr.hpp> -#include <boost/smart_ptr/detail/sp_forward.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> -#include <boost/type_traits/type_with_alignment.hpp> -#include <boost/type_traits/alignment_of.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> +#include <boost/config.hpp> +#include <utility> #include <cstddef> #include <new> +#include <type_traits> namespace boost { - namespace detail { @@ -34,7 +29,7 @@ template< std::size_t N, std::size_t A > struct sp_aligned_storage union type { char data_[ N ]; - typename boost::type_with_alignment< A >::type align_; + typename sp_type_with_alignment< A >::type align_; }; }; @@ -42,14 +37,14 @@ template< class T > class sp_ms_deleter { private: - typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type; + typedef typename sp_aligned_storage< sizeof( T ), std::alignment_of< T >::value >::type storage_type; bool initialized_; storage_type storage_; private: - void destroy() BOOST_SP_NOEXCEPT + void destroy() noexcept { if( initialized_ ) { @@ -71,39 +66,39 @@ private: public: - sp_ms_deleter() BOOST_SP_NOEXCEPT : initialized_( false ) + sp_ms_deleter() noexcept : initialized_( false ) { } - template<class A> explicit sp_ms_deleter( A const & ) BOOST_SP_NOEXCEPT : initialized_( false ) + template<class A> explicit sp_ms_deleter( A const & ) noexcept : initialized_( false ) { } // optimization: do not copy storage_ - sp_ms_deleter( sp_ms_deleter const & ) BOOST_SP_NOEXCEPT : initialized_( false ) + sp_ms_deleter( sp_ms_deleter const & ) noexcept : initialized_( false ) { } - ~sp_ms_deleter() BOOST_SP_NOEXCEPT + ~sp_ms_deleter() noexcept { destroy(); } - void operator()( T * ) BOOST_SP_NOEXCEPT + void operator()( T * ) noexcept { destroy(); } - static void operator_fn( T* ) BOOST_SP_NOEXCEPT // operator() can't be static + static void operator_fn( T* ) noexcept // operator() can't be static { } - void * address() BOOST_SP_NOEXCEPT + void * address() noexcept { return storage_.data_; } - void set_initialized() BOOST_SP_NOEXCEPT + void set_initialized() noexcept { initialized_ = true; } @@ -113,7 +108,7 @@ template< class T, class A > class sp_as_deleter { private: - typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type; + typedef typename sp_aligned_storage< sizeof( T ), std::alignment_of< T >::value >::type storage_type; storage_type storage_; A a_; @@ -121,57 +116,49 @@ private: private: - void destroy() BOOST_SP_NOEXCEPT + void destroy() noexcept { if( initialized_ ) { T * p = reinterpret_cast< T* >( storage_.data_ ); -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - std::allocator_traits<A>::destroy( a_, p ); -#else - - p->~T(); - -#endif - initialized_ = false; } } public: - sp_as_deleter( A const & a ) BOOST_SP_NOEXCEPT : a_( a ), initialized_( false ) + sp_as_deleter( A const & a ) noexcept : a_( a ), initialized_( false ) { } // optimization: do not copy storage_ - sp_as_deleter( sp_as_deleter const & r ) BOOST_SP_NOEXCEPT : a_( r.a_), initialized_( false ) + sp_as_deleter( sp_as_deleter const & r ) noexcept : a_( r.a_), initialized_( false ) { } - ~sp_as_deleter() BOOST_SP_NOEXCEPT + ~sp_as_deleter() noexcept { destroy(); } - void operator()( T * ) BOOST_SP_NOEXCEPT + void operator()( T * ) noexcept { destroy(); } - static void operator_fn( T* ) BOOST_SP_NOEXCEPT // operator() can't be static + static void operator_fn( T* ) noexcept // operator() can't be static { } - void * address() BOOST_SP_NOEXCEPT + void * address() noexcept { return storage_.data_; } - void set_initialized() BOOST_SP_NOEXCEPT + void set_initialized() noexcept { initialized_ = true; } @@ -182,29 +169,17 @@ template< class T > struct sp_if_not_array typedef boost::shared_ptr< T > type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_if_not_array< T[] > { }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_if_not_array< T[N] > { }; -#endif - -#endif - } // namespace detail -#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) -# define BOOST_SP_MSD( T ) boost::detail::sp_inplace_tag< boost::detail::sp_ms_deleter< T > >() -#else -# define BOOST_SP_MSD( T ) boost::detail::sp_ms_deleter< T >() -#endif +#define BOOST_SP_MSD( T ) boost::detail::sp_inplace_tag< boost::detail::sp_ms_deleter< T > >() // _noinit versions @@ -242,9 +217,7 @@ template< class T, class A > typename boost::detail::sp_if_not_array< T >::type return boost::shared_ptr< T >( pt, pt2 ); } -#if !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -// Variadic templates, rvalue reference +// template< class T, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Args && ... args ) { @@ -254,7 +227,7 @@ template< class T, class... Args > typename boost::detail::sp_if_not_array< T >: void * pv = pd->address(); - ::new( pv ) T( boost::detail::sp_forward<Args>( args )... ); + ::new( pv ) T( std::forward<Args>( args )... ); pd->set_initialized(); T * pt2 = static_cast< T* >( pv ); @@ -265,8 +238,6 @@ template< class T, class... Args > typename boost::detail::sp_if_not_array< T >: template< class T, class A, class... Args > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, Args && ... args ) { -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - typedef typename std::allocator_traits<A>::template rebind_alloc<T> A2; A2 a2( a ); @@ -274,222 +245,10 @@ template< class T, class A, class... Args > typename boost::detail::sp_if_not_ar boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_inplace_tag<D>(), a2 ); -#else - - typedef boost::detail::sp_ms_deleter< T > D; - - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_inplace_tag<D>(), a ); - -#endif - D * pd = static_cast< D* >( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); -#if !defined( BOOST_NO_CXX11_ALLOCATOR ) - - std::allocator_traits<A2>::construct( a2, static_cast< T* >( pv ), boost::detail::sp_forward<Args>( args )... ); - -#else - - ::new( pv ) T( boost::detail::sp_forward<Args>( args )... ); - -#endif - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -#else // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -// Common zero-argument versions - -template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared() -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T(); - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T(); - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -// C++03 version - -template< class T, class A1 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ) - ); + std::allocator_traits<A2>::construct( a2, static_cast< T* >( pv ), std::forward<Args>( args )... ); pd->set_initialized(); @@ -499,302 +258,6 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1 return boost::shared_ptr< T >( pt, pt2 ); } -template< class T, class A, class A1, class A2, class A3, class A4 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ), - boost::forward<A8>( a8 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ), - boost::forward<A8>( a8 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8, BOOST_FWD_REF(A9) a9 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ), - boost::forward<A8>( a8 ), - boost::forward<A9>( a9 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8, BOOST_FWD_REF(A9) a9 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward<A1>( a1 ), - boost::forward<A2>( a2 ), - boost::forward<A3>( a3 ), - boost::forward<A4>( a4 ), - boost::forward<A5>( a5 ), - boost::forward<A6>( a6 ), - boost::forward<A7>( a7 ), - boost::forward<A8>( a8 ), - boost::forward<A9>( a9 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -#endif // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - #undef BOOST_SP_MSD } // namespace boost diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_unique.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_unique.hpp index c2c6ef30e4..fe7fb3d67f 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_unique.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/make_unique.hpp @@ -8,61 +8,55 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP #define BOOST_SMART_PTR_MAKE_UNIQUE_HPP -#include <boost/smart_ptr/detail/requires_cxx11.hpp> -#include <boost/type_traits/enable_if.hpp> -#include <boost/type_traits/is_array.hpp> -#include <boost/type_traits/is_unbounded_array.hpp> -#include <boost/type_traits/remove_extent.hpp> -#include <boost/type_traits/remove_reference.hpp> +#include <boost/smart_ptr/detail/sp_type_traits.hpp> #include <memory> +#include <type_traits> #include <utility> namespace boost { template<class T> -inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type make_unique() { return std::unique_ptr<T>(new T()); } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template<class T, class... Args> -inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type make_unique(Args&&... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } -#endif template<class T> -inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type -make_unique(typename remove_reference<T>::type&& value) +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type +make_unique(typename std::remove_reference<T>::type&& value) { return std::unique_ptr<T>(new T(std::move(value))); } template<class T> -inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type +inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type make_unique_noinit() { return std::unique_ptr<T>(new T); } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, std::unique_ptr<T> >::type make_unique(std::size_t size) { - return std::unique_ptr<T>(new typename remove_extent<T>::type[size]()); + return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]()); } template<class T> -inline typename enable_if_<is_unbounded_array<T>::value, +inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, std::unique_ptr<T> >::type make_unique_noinit(std::size_t size) { - return std::unique_ptr<T>(new typename remove_extent<T>::type[size]); + return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]); } } /* boost */ diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_equal_to.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_equal_to.hpp index a43e9545da..b80d035ba4 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_equal_to.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_equal_to.hpp @@ -5,8 +5,6 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include <boost/config.hpp> - namespace boost { @@ -16,7 +14,7 @@ template<class T = void> struct owner_equal_to typedef T first_argument_type; typedef T second_argument_type; - template<class U, class V> bool operator()( U const & u, V const & v ) const BOOST_NOEXCEPT + template<class U, class V> bool operator()( U const & u, V const & v ) const noexcept { return u.owner_equals( v ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_hash.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_hash.hpp index 4378d91708..47aa1b475f 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_hash.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_hash.hpp @@ -5,7 +5,6 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include <boost/config.hpp> #include <cstddef> namespace boost @@ -16,7 +15,7 @@ template<class T> struct owner_hash typedef std::size_t result_type; typedef T argument_type; - std::size_t operator()( T const & t ) const BOOST_NOEXCEPT + std::size_t operator()( T const & t ) const noexcept { return t.owner_hash_value(); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_less.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_less.hpp index 1c0a7d25bf..0c569649ae 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_less.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/owner_less.hpp @@ -14,8 +14,6 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/config.hpp> - namespace boost { @@ -25,7 +23,7 @@ template<class T = void> struct owner_less typedef T first_argument_type; typedef T second_argument_type; - template<class U, class V> bool operator()( U const & u, V const & v ) const BOOST_NOEXCEPT + template<class U, class V> bool operator()( U const & u, V const & v ) const noexcept { return u.owner_before( v ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_array.hpp index d3c250d075..b04c021daa 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_array.hpp @@ -10,13 +10,11 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> -#include <boost/config.hpp> -#include <boost/assert.hpp> -#include <boost/core/checked_delete.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> - +#include <boost/smart_ptr/detail/deprecated_macros.hpp> +#include <boost/core/checked_delete.hpp> +#include <boost/assert.hpp> +#include <boost/config.hpp> #include <boost/config/workaround.hpp> #include <cstddef> // for std::ptrdiff_t @@ -55,14 +53,14 @@ public: typedef T element_type; - explicit scoped_array( T * p = 0 ) BOOST_SP_NOEXCEPT : px( p ) + explicit scoped_array( T * p = 0 ) noexcept : px( p ) { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_array_constructor_hook( px ); #endif } - ~scoped_array() BOOST_SP_NOEXCEPT + ~scoped_array() noexcept { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_array_destructor_hook( px ); @@ -83,15 +81,17 @@ public: return px[i]; } - T * get() const BOOST_SP_NOEXCEPT + T * get() const noexcept { return px; } -// implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - void swap(scoped_array & b) BOOST_SP_NOEXCEPT + void swap(scoped_array & b) noexcept { T * tmp = b.px; b.px = px; @@ -99,31 +99,27 @@ public: } }; -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( scoped_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( scoped_array<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, scoped_array<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( scoped_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( scoped_array<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, scoped_array<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) BOOST_SP_NOEXCEPT +template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) noexcept { a.swap(b); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_ptr.hpp index da8df191be..c71d70d02d 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/scoped_ptr.hpp @@ -10,14 +10,14 @@ // // See http://www.boost.org/libs/smart_ptr/ for documentation. -#include <boost/smart_ptr/detail/requires_cxx11.hpp> -#include <boost/config.hpp> -#include <boost/assert.hpp> -#include <boost/core/checked_delete.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_disable_deprecated.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/smart_ptr/detail/deprecated_macros.hpp> +#include <boost/core/checked_delete.hpp> +#include <boost/assert.hpp> #include <boost/config/workaround.hpp> +#include <boost/config.hpp> +#include <cstddef> #ifndef BOOST_NO_AUTO_PTR # include <memory> // for std::auto_ptr @@ -63,7 +63,7 @@ public: typedef T element_type; - explicit scoped_ptr( T * p = 0 ) BOOST_SP_NOEXCEPT : px( p ) + explicit scoped_ptr( T * p = 0 ) noexcept : px( p ) { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_constructor_hook( px ); @@ -72,7 +72,7 @@ public: #ifndef BOOST_NO_AUTO_PTR - explicit scoped_ptr( std::auto_ptr<T> p ) BOOST_SP_NOEXCEPT : px( p.release() ) + explicit scoped_ptr( std::auto_ptr<T> p ) noexcept : px( p.release() ) { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_constructor_hook( px ); @@ -81,7 +81,7 @@ public: #endif - ~scoped_ptr() BOOST_SP_NOEXCEPT + ~scoped_ptr() noexcept { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_scalar_destructor_hook( px ); @@ -107,15 +107,17 @@ public: return px; } - T * get() const BOOST_SP_NOEXCEPT + T * get() const noexcept { return px; } -// implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - void swap(scoped_ptr & b) BOOST_SP_NOEXCEPT + void swap(scoped_ptr & b) noexcept { T * tmp = b.px; b.px = px; @@ -123,38 +125,34 @@ public: } }; -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( scoped_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( scoped_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, scoped_ptr<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( scoped_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( scoped_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, scoped_ptr<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) BOOST_SP_NOEXCEPT +template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) noexcept { a.swap(b); } // get_pointer(p) is a generic way to say p.get() -template<class T> inline T * get_pointer(scoped_ptr<T> const & p) BOOST_SP_NOEXCEPT +template<class T> inline T * get_pointer(scoped_ptr<T> const & p) noexcept { return p.get(); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_array.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_array.hpp index 05933e04c3..005175b521 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_array.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_array.hpp @@ -14,24 +14,17 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> - -#include <boost/config.hpp> // for broken compiler workarounds - -#include <memory> // TR1 cyclic inclusion fix - -#include <boost/assert.hpp> -#include <boost/core/checked_delete.hpp> - #include <boost/smart_ptr/shared_ptr.hpp> #include <boost/smart_ptr/detail/shared_count.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> +#include <boost/core/checked_delete.hpp> +#include <boost/assert.hpp> +#include <boost/config.hpp> #include <boost/config/workaround.hpp> -#include <cstddef> // for std::ptrdiff_t #include <algorithm> // for std::swap #include <functional> // for std::less +#include <cstddef> // for std::ptrdiff_t namespace boost { @@ -56,18 +49,14 @@ public: typedef T element_type; - shared_array() BOOST_SP_NOEXCEPT : px( 0 ), pn() + shared_array() noexcept : px( 0 ), pn() { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - shared_array( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() + shared_array( std::nullptr_t ) noexcept : px( 0 ), pn() { } -#endif - template<class Y> explicit shared_array( Y * p ): px( p ), pn( p, checked_array_deleter<Y>() ) { @@ -93,36 +82,23 @@ public: } // generated copy constructor, destructor are fine... - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // ... except in C++0x, move disables the implicit copy - shared_array( shared_array const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + shared_array( shared_array const & r ) noexcept : px( r.px ), pn( r.pn ) { } - shared_array( shared_array && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn() + shared_array( shared_array && r ) noexcept : px( r.px ), pn() { pn.swap( r.pn ); r.px = 0; } -#endif - // conversion template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_array( shared_array<Y> const & r, typename boost::detail::sp_enable_if_convertible< Y[], T[] >::type = boost::detail::sp_empty() ) - -#else - - shared_array( shared_array<Y> const & r ) - -#endif - BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y[], T[] >(); } @@ -130,47 +106,39 @@ public: // aliasing template< class Y > - shared_array( shared_array<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) + shared_array( shared_array<Y> const & r, element_type * p ) noexcept : px( p ), pn( r.pn ) { } // assignment - shared_array & operator=( shared_array const & r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array const & r ) noexcept { this_type( r ).swap( *this ); return *this; } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400) - template<class Y> - shared_array & operator=( shared_array<Y> const & r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array<Y> const & r ) noexcept { this_type( r ).swap( *this ); return *this; } -#endif - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - shared_array & operator=( shared_array && r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array && r ) noexcept { this_type( static_cast< shared_array && >( r ) ).swap( *this ); return *this; } template<class Y> - shared_array & operator=( shared_array<Y> && r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array<Y> && r ) noexcept { this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this ); return *this; } -#endif - - void reset() BOOST_SP_NOEXCEPT + void reset() noexcept { this_type().swap( *this ); } @@ -191,7 +159,7 @@ public: this_type( p, d, a ).swap( *this ); } - template<class Y> void reset( shared_array<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT + template<class Y> void reset( shared_array<Y> const & r, element_type * p ) noexcept { this_type( r, p ).swap( *this ); } @@ -203,31 +171,33 @@ public: return px[i]; } - T * get() const BOOST_SP_NOEXCEPT + T * get() const noexcept { return px; } -// implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - bool unique() const BOOST_SP_NOEXCEPT + bool unique() const noexcept { return pn.unique(); } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pn.use_count(); } - void swap(shared_array<T> & other) BOOST_SP_NOEXCEPT + void swap(shared_array<T> & other) noexcept { std::swap(px, other.px); pn.swap(other.pn); } - void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const noexcept { return pn.get_deleter( ti ); } @@ -241,51 +211,47 @@ private: }; // shared_array -template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) noexcept { return a.get() == b.get(); } -template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) noexcept { return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( shared_array<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, shared_array<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( shared_array<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, shared_array<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT +template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) noexcept { return std::less<T*>()(a.get(), b.get()); } -template<class T> void swap(shared_array<T> & a, shared_array<T> & b) BOOST_SP_NOEXCEPT +template<class T> void swap(shared_array<T> & a, shared_array<T> & b) noexcept { a.swap(b); } -template< class D, class T > D * get_deleter( shared_array<T> const & p ) BOOST_SP_NOEXCEPT +template< class D, class T > D * get_deleter( shared_array<T> const & p ) noexcept { return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID_(D) ) ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_ptr.hpp index efd06bc322..2431a33590 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/shared_ptr.hpp @@ -14,10 +14,8 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/detail/shared_count.hpp> #include <boost/smart_ptr/detail/sp_convertible.hpp> -#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_disable_deprecated.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <boost/core/checked_delete.hpp> @@ -35,14 +33,7 @@ #include <typeinfo> // for std::bad_cast #include <cstddef> // for std::size_t #include <memory> // for std::auto_ptr - -#if !defined(BOOST_NO_IOSTREAM) -#if !defined(BOOST_NO_IOSFWD) #include <iosfwd> // for std::basic_ostream -#else -#include <ostream> -#endif -#endif #if defined( BOOST_SP_DISABLE_DEPRECATED ) #pragma GCC diagnostic push @@ -74,24 +65,16 @@ template< class T > struct sp_element typedef T type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_element< T[] > { typedef T type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_element< T[N] > { typedef T type; }; -#endif - -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_dereference, return type of operator* template< class T > struct sp_dereference @@ -104,8 +87,6 @@ template<> struct sp_dereference< void > typedef void type; }; -#if !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) - template<> struct sp_dereference< void const > { typedef void type; @@ -121,26 +102,16 @@ template<> struct sp_dereference< void const volatile > typedef void type; }; -#endif // !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_dereference< T[] > { typedef void type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_dereference< T[N] > { typedef void type; }; -#endif - -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_member_access, return type of operator-> template< class T > struct sp_member_access @@ -148,24 +119,16 @@ template< class T > struct sp_member_access typedef T * type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_member_access< T[] > { typedef void type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_member_access< T[N] > { typedef void type; }; -#endif - -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_array_access, return type of operator[] template< class T > struct sp_array_access @@ -173,24 +136,16 @@ template< class T > struct sp_array_access typedef void type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_array_access< T[] > { typedef T & type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_array_access< T[N] > { typedef T & type; }; -#endif - -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_extent, for operator[] index check template< class T > struct sp_extent @@ -198,15 +153,11 @@ template< class T > struct sp_extent enum _vt { value = 0 }; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T, std::size_t N > struct sp_extent< T[N] > { enum _vt { value = N }; }; -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // enable_shared_from_this support template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe ) @@ -240,37 +191,11 @@ inline void sp_enable_shared_from_this( ... ) #endif // _MANAGED -#if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_AUTO_PTR ) - -// rvalue auto_ptr support based on a technique by Dave Abrahams - -template< class T, class R > struct sp_enable_if_auto_ptr -{ -}; - -template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R > -{ - typedef R type; -}; - -#endif - // sp_assert_convertible -template< class Y, class T > inline void sp_assert_convertible() BOOST_SP_NOEXCEPT +template< class Y, class T > inline void sp_assert_convertible() noexcept { -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - - // static_assert( sp_convertible< Y, T >::value ); - typedef char tmp[ sp_convertible< Y, T >::value? 1: -1 ]; - (void)sizeof( tmp ); - -#else - - T* p = static_cast< Y* >( 0 ); - (void)p; - -#endif + static_assert( sp_convertible< Y, T >::value, "incompatible pointer type" ); } // pointer constructor helper @@ -281,8 +206,6 @@ template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr boost::detail::sp_enable_shared_from_this( ppx, p, p ); } -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) { sp_assert_convertible< Y[], T[] >(); @@ -295,8 +218,6 @@ template< class T, std::size_t N, class Y > inline void sp_pointer_construct( bo boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn ); } -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // deleter constructor helper template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T > * ppx, Y * p ) @@ -304,8 +225,6 @@ template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr boost::detail::sp_enable_shared_from_this( ppx, p, p ); } -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * /*p*/ ) { sp_assert_convertible< Y[], T[] >(); @@ -316,8 +235,6 @@ template< class T, std::size_t N, class Y > inline void sp_deleter_construct( bo sp_assert_convertible< Y[N], T[N] >(); } -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - struct sp_internal_constructor_tag { }; @@ -344,30 +261,22 @@ public: typedef typename boost::detail::sp_element< T >::type element_type; - BOOST_CONSTEXPR shared_ptr() BOOST_SP_NOEXCEPT : px( 0 ), pn() + constexpr shared_ptr() noexcept : px( 0 ), pn() { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() + constexpr shared_ptr( std::nullptr_t ) noexcept : px( 0 ), pn() { } -#endif - - BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count const & pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ ) + constexpr shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count const & pn_ ) noexcept : px( px_ ), pn( pn_ ) { } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( std::move( pn_ ) ) + constexpr shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) noexcept : px( px_ ), pn( std::move( pn_ ) ) { } -#endif - template<class Y> explicit shared_ptr( Y * p ): px( p ), pn() // Y must be complete { @@ -380,88 +289,33 @@ public: // shared_ptr will release p by calling d(p) // -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, static_cast< D&& >( d ) ) { boost::detail::sp_deleter_construct( this, p ); } -#else - - template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, d ) - { - boost::detail::sp_deleter_construct( this, p ); - } - -#endif - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class D> shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) ) + template<class D> shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) ) { } -#else - - template<class D> shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d ) - { - } - -#endif - -#endif - // As above, but with allocator. A's copy constructor shall not throw. -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a ) { boost::detail::sp_deleter_construct( this, p ); } -#else - - template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a ) - { - boost::detail::sp_deleter_construct( this, p ); - } - -#endif - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a ) - { - } - -#else - - template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a ) + template<class D, class A> shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a ) { } -#endif - -#endif - // generated copy constructor, destructor are fine... - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // ... except in C++0x, move disables the implicit copy - shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + shared_ptr( shared_ptr const & r ) noexcept : px( r.px ), pn( r.pn ) { } -#endif - template<class Y> explicit shared_ptr( weak_ptr<Y> const & r ): pn( r.pn ) // may throw { @@ -473,7 +327,7 @@ public: template<class Y> shared_ptr( weak_ptr<Y> const & r, boost::detail::sp_nothrow_tag ) - BOOST_SP_NOEXCEPT : px( 0 ), pn( r.pn, boost::detail::sp_nothrow_tag() ) + noexcept : px( 0 ), pn( r.pn, boost::detail::sp_nothrow_tag() ) { if( !pn.empty() ) { @@ -482,23 +336,15 @@ public: } template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) - -#else - - shared_ptr( shared_ptr<Y> const & r ) - -#endif - BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y, T >(); } // aliasing template< class Y > - shared_ptr( shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) + shared_ptr( shared_ptr<Y> const & r, element_type * p ) noexcept : px( p ), pn( r.pn ) { } @@ -515,8 +361,6 @@ public: boost::detail::sp_deleter_construct( this, tmp ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn() { @@ -528,27 +372,8 @@ public: boost::detail::sp_deleter_construct( this, tmp ); } -#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - - template<class Ap> - explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr<Ap, int>::type = 0 ): px( r.get() ), pn() - { - typedef typename Ap::element_type Y; - - boost::detail::sp_assert_convertible< Y, T >(); - - Y * tmp = r.get(); - pn = boost::detail::shared_count( r ); - - boost::detail::sp_deleter_construct( this, tmp ); - } - -#endif // BOOST_NO_SFINAE, BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - #endif // BOOST_NO_AUTO_PTR -#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template< class Y, class D > shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn() { @@ -563,8 +388,6 @@ public: } } -#endif - template< class Y, class D > shared_ptr( boost::movelib::unique_ptr< Y, D > r ): px( r.get() ), pn() { @@ -581,23 +404,19 @@ public: // assignment - shared_ptr & operator=( shared_ptr const & r ) BOOST_SP_NOEXCEPT + shared_ptr & operator=( shared_ptr const & r ) noexcept { this_type(r).swap(*this); return *this; } -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400) - template<class Y> - shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_SP_NOEXCEPT + shared_ptr & operator=(shared_ptr<Y> const & r) noexcept { this_type(r).swap(*this); return *this; } -#endif - #ifndef BOOST_NO_AUTO_PTR template<class Y> @@ -607,8 +426,6 @@ public: return *this; } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> shared_ptr & operator=( std::auto_ptr<Y> && r ) { @@ -616,21 +433,8 @@ public: return *this; } -#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - - template<class Ap> - typename boost::detail::sp_enable_if_auto_ptr< Ap, shared_ptr & >::type operator=( Ap r ) - { - this_type( r ).swap( *this ); - return *this; - } - -#endif // BOOST_NO_SFINAE, BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - #endif // BOOST_NO_AUTO_PTR -#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y, class D> shared_ptr & operator=( std::unique_ptr<Y, D> && r ) { @@ -638,8 +442,6 @@ public: return *this; } -#endif - template<class Y, class D> shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r ) { @@ -666,37 +468,27 @@ public: // Move support -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) ) + shared_ptr( shared_ptr && r ) noexcept : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) ) { r.px = 0; } template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) - -#else - - shared_ptr( shared_ptr<Y> && r ) - -#endif - BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) ) + noexcept : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) ) { boost::detail::sp_assert_convertible< Y, T >(); r.px = 0; } - shared_ptr & operator=( shared_ptr && r ) BOOST_SP_NOEXCEPT + shared_ptr & operator=( shared_ptr && r ) noexcept { this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); return *this; } template<class Y> - shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_SP_NOEXCEPT + shared_ptr & operator=( shared_ptr<Y> && r ) noexcept { this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this ); return *this; @@ -704,25 +496,19 @@ public: // aliasing move template<class Y> - shared_ptr( shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn() + shared_ptr( shared_ptr<Y> && r, element_type * p ) noexcept : px( p ), pn() { pn.swap( r.pn ); r.px = 0; } -#endif - -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT + shared_ptr & operator=( std::nullptr_t ) noexcept { this_type().swap(*this); return *this; } -#endif - - void reset() BOOST_SP_NOEXCEPT + void reset() noexcept { this_type().swap(*this); } @@ -733,8 +519,6 @@ public: this_type( p ).swap( *this ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y, class D> void reset( Y * p, D d ) { this_type( p, static_cast< D&& >( d ) ).swap( *this ); @@ -745,34 +529,16 @@ public: this_type( p, static_cast< D&& >( d ), a ).swap( *this ); } -#else - - template<class Y, class D> void reset( Y * p, D d ) - { - this_type( p, d ).swap( *this ); - } - - template<class Y, class D, class A> void reset( Y * p, D d, A a ) - { - this_type( p, d, a ).swap( *this ); - } - -#endif - - template<class Y> void reset( shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT + template<class Y> void reset( shared_ptr<Y> const & r, element_type * p ) noexcept { this_type( r, p ).swap( *this ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class Y> void reset( shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT + template<class Y> void reset( shared_ptr<Y> && r, element_type * p ) noexcept { this_type( static_cast< shared_ptr<Y> && >( r ), p ).swap( *this ); } -#endif - typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT_WITH_ASSERT { BOOST_ASSERT( px != 0 ); @@ -793,143 +559,134 @@ public: return static_cast< typename boost::detail::sp_array_access< T >::type >( px[ i ] ); } - element_type * get() const BOOST_SP_NOEXCEPT + element_type * get() const noexcept { return px; } -// implicit conversion to "bool" -#include <boost/smart_ptr/detail/operator_bool.hpp> + explicit operator bool () const noexcept + { + return px != 0; + } - bool unique() const BOOST_SP_NOEXCEPT + bool unique() const noexcept { return pn.unique(); } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pn.use_count(); } - void swap( shared_ptr & other ) BOOST_SP_NOEXCEPT + void swap( shared_ptr & other ) noexcept { std::swap(px, other.px); pn.swap(other.pn); } - template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const noexcept { return pn < rhs.pn; } - template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const noexcept { return pn < rhs.pn; } - template<class Y> bool owner_equals( shared_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_equals( shared_ptr<Y> const & rhs ) const noexcept { return pn == rhs.pn; } - template<class Y> bool owner_equals( weak_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_equals( weak_ptr<Y> const & rhs ) const noexcept { return pn == rhs.pn; } - std::size_t owner_hash_value() const BOOST_SP_NOEXCEPT + std::size_t owner_hash_value() const noexcept { return pn.hash_value(); } - void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const noexcept { return pn.get_deleter( ti ); } - void * _internal_get_local_deleter( boost::detail::sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * _internal_get_local_deleter( boost::detail::sp_typeinfo_ const & ti ) const noexcept { return pn.get_local_deleter( ti ); } - void * _internal_get_untyped_deleter() const BOOST_SP_NOEXCEPT + void * _internal_get_untyped_deleter() const noexcept { return pn.get_untyped_deleter(); } - bool _internal_equiv( shared_ptr const & r ) const BOOST_SP_NOEXCEPT + bool _internal_equiv( shared_ptr const & r ) const noexcept { return px == r.px && pn == r.pn; } - boost::detail::shared_count _internal_count() const BOOST_SP_NOEXCEPT + boost::detail::shared_count _internal_count() const noexcept { return pn; } -// Tasteless as this may seem, making all members public allows member templates -// to work in the absence of member template friends. (Matthew Langston) - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - private: template<class Y> friend class shared_ptr; template<class Y> friend class weak_ptr; -#endif - element_type * px; // contained pointer boost::detail::shared_count pn; // reference counter }; // shared_ptr -template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b) noexcept { return a.get() == b.get(); } -template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b) noexcept { return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( shared_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator==( std::nullptr_t, shared_ptr<T> const & p ) noexcept { return p.get() == 0; } -template<class T> inline bool operator!=( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( shared_ptr<T> const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class T> inline bool operator!=( std::nullptr_t, shared_ptr<T> const & p ) noexcept { return p.get() != 0; } -#endif - -template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b) noexcept { return a.owner_before( b ); } -template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b) BOOST_SP_NOEXCEPT +template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b) noexcept { a.swap(b); } -template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> const & r ) noexcept { (void) static_cast< T* >( static_cast< U* >( 0 ) ); @@ -939,7 +696,7 @@ template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> cons return shared_ptr<T>( r, p ); } -template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> const & r ) noexcept { (void) const_cast< T* >( static_cast< U* >( 0 ) ); @@ -949,7 +706,7 @@ template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> const return shared_ptr<T>( r, p ); } -template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) noexcept { (void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); @@ -959,7 +716,7 @@ template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> con return p? shared_ptr<T>( r, p ): shared_ptr<T>(); } -template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> const & r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -969,9 +726,7 @@ template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> return shared_ptr<T>( r, p ); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> && r ) noexcept { (void) static_cast< T* >( static_cast< U* >( 0 ) ); @@ -981,7 +736,7 @@ template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> && r return shared_ptr<T>( std::move(r), p ); } -template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> && r ) noexcept { (void) const_cast< T* >( static_cast< U* >( 0 ) ); @@ -991,7 +746,7 @@ template<class T, class U> shared_ptr<T> const_pointer_cast( shared_ptr<U> && r return shared_ptr<T>( std::move(r), p ); } -template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) noexcept { (void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); @@ -1001,7 +756,7 @@ template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && return p? shared_ptr<T>( std::move(r), p ): shared_ptr<T>(); } -template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT +template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> && r ) noexcept { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); @@ -1011,62 +766,33 @@ template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U> return shared_ptr<T>( std::move(r), p ); } -#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // get_pointer() enables boost::mem_fn to recognize shared_ptr -template<class T> inline typename shared_ptr<T>::element_type * get_pointer(shared_ptr<T> const & p) BOOST_SP_NOEXCEPT +template<class T> inline typename shared_ptr<T>::element_type * get_pointer(shared_ptr<T> const & p) noexcept { return p.get(); } // operator<< -#if !defined(BOOST_NO_IOSTREAM) - -#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) ) - template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p) { os << p.get(); return os; } -#else - -// in STLport's no-iostreams mode no iostream symbols can be used -#ifndef _STLP_NO_IOSTREAMS - -# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) -// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL -using std::basic_ostream; -template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, shared_ptr<Y> const & p) -# else -template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p) -# endif -{ - os << p.get(); - return os; -} - -#endif // _STLP_NO_IOSTREAMS - -#endif // __GNUC__ < 3 - -#endif // !defined(BOOST_NO_IOSTREAM) - // get_deleter namespace detail { -template<class D, class T> D * basic_get_deleter( shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class D, class T> D * basic_get_deleter( shared_ptr<T> const & p ) noexcept { return static_cast<D *>( p._internal_get_deleter(BOOST_SP_TYPEID_(D)) ); } -template<class D, class T> D * basic_get_local_deleter( D *, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT; -template<class D, class T> D const * basic_get_local_deleter( D const *, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT; +template<class D, class T> D * basic_get_local_deleter( D *, shared_ptr<T> const & p ) noexcept; +template<class D, class T> D const * basic_get_local_deleter( D const *, shared_ptr<T> const & p ) noexcept; class esft2_deleter_wrapper { @@ -1076,16 +802,16 @@ private: public: - esft2_deleter_wrapper() BOOST_SP_NOEXCEPT + esft2_deleter_wrapper() noexcept { } - template< class T > void set_deleter( shared_ptr<T> const & deleter ) BOOST_SP_NOEXCEPT + template< class T > void set_deleter( shared_ptr<T> const & deleter ) noexcept { deleter_ = deleter; } - template<typename D> D* get_deleter() const BOOST_SP_NOEXCEPT + template<typename D> D* get_deleter() const noexcept { return boost::detail::basic_get_deleter<D>( deleter_ ); } @@ -1099,7 +825,7 @@ public: } // namespace detail -template<class D, class T> D * get_deleter( shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class D, class T> D * get_deleter( shared_ptr<T> const & p ) noexcept { D * d = boost::detail::basic_get_deleter<D>( p ); @@ -1123,34 +849,34 @@ template<class D, class T> D * get_deleter( shared_ptr<T> const & p ) BOOST_SP_N #if !defined(BOOST_SP_NO_ATOMIC_ACCESS) -template<class T> inline bool atomic_is_lock_free( shared_ptr<T> const * /*p*/ ) BOOST_SP_NOEXCEPT +template<class T> inline bool atomic_is_lock_free( shared_ptr<T> const * /*p*/ ) noexcept { return false; } -template<class T> shared_ptr<T> atomic_load( shared_ptr<T> const * p ) BOOST_SP_NOEXCEPT +template<class T> shared_ptr<T> atomic_load( shared_ptr<T> const * p ) noexcept { boost::detail::spinlock_pool<2>::scoped_lock lock( p ); return *p; } -template<class T, class M> inline shared_ptr<T> atomic_load_explicit( shared_ptr<T> const * p, /*memory_order mo*/ M ) BOOST_SP_NOEXCEPT +template<class T, class M> inline shared_ptr<T> atomic_load_explicit( shared_ptr<T> const * p, /*memory_order mo*/ M ) noexcept { return atomic_load( p ); } -template<class T> void atomic_store( shared_ptr<T> * p, shared_ptr<T> r ) BOOST_SP_NOEXCEPT +template<class T> void atomic_store( shared_ptr<T> * p, shared_ptr<T> r ) noexcept { boost::detail::spinlock_pool<2>::scoped_lock lock( p ); p->swap( r ); } -template<class T, class M> inline void atomic_store_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ M ) BOOST_SP_NOEXCEPT +template<class T, class M> inline void atomic_store_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ M ) noexcept { atomic_store( p, r ); // std::move( r ) } -template<class T> shared_ptr<T> atomic_exchange( shared_ptr<T> * p, shared_ptr<T> r ) BOOST_SP_NOEXCEPT +template<class T> shared_ptr<T> atomic_exchange( shared_ptr<T> * p, shared_ptr<T> r ) noexcept { boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p ); @@ -1161,12 +887,12 @@ template<class T> shared_ptr<T> atomic_exchange( shared_ptr<T> * p, shared_ptr<T return r; // return std::move( r ) } -template<class T, class M> shared_ptr<T> inline atomic_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ M ) BOOST_SP_NOEXCEPT +template<class T, class M> shared_ptr<T> inline atomic_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ M ) noexcept { return atomic_exchange( p, r ); // std::move( r ) } -template<class T> bool atomic_compare_exchange( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w ) BOOST_SP_NOEXCEPT +template<class T> bool atomic_compare_exchange( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w ) noexcept { boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p ); @@ -1191,7 +917,7 @@ template<class T> bool atomic_compare_exchange( shared_ptr<T> * p, shared_ptr<T> } } -template<class T, class M> inline bool atomic_compare_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w, /*memory_order success*/ M, /*memory_order failure*/ M ) BOOST_SP_NOEXCEPT +template<class T, class M> inline bool atomic_compare_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w, /*memory_order success*/ M, /*memory_order failure*/ M ) noexcept { return atomic_compare_exchange( p, v, w ); // std::move( w ) } @@ -1202,7 +928,7 @@ template<class T, class M> inline bool atomic_compare_exchange_explicit( shared_ template< class T > struct hash; -template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p ) noexcept { return boost::hash< typename boost::shared_ptr<T>::element_type* >()( p.get() ); } @@ -1211,14 +937,12 @@ template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p ) BOO // std::hash -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - namespace std { template<class T> struct hash< ::boost::shared_ptr<T> > { - std::size_t operator()( ::boost::shared_ptr<T> const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::boost::shared_ptr<T> const & p ) const noexcept { return std::hash< typename ::boost::shared_ptr<T>::element_type* >()( p.get() ); } @@ -1226,8 +950,6 @@ template<class T> struct hash< ::boost::shared_ptr<T> > } // namespace std -#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - #include <boost/smart_ptr/detail/local_sp_deleter.hpp> namespace boost @@ -1236,12 +958,12 @@ namespace boost namespace detail { -template<class D, class T> D * basic_get_local_deleter( D *, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class D, class T> D * basic_get_local_deleter( D *, shared_ptr<T> const & p ) noexcept { return static_cast<D *>( p._internal_get_local_deleter( BOOST_SP_TYPEID_(local_sp_deleter<D>) ) ); } -template<class D, class T> D const * basic_get_local_deleter( D const *, shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template<class D, class T> D const * basic_get_local_deleter( D const *, shared_ptr<T> const & p ) noexcept { return static_cast<D *>( p._internal_get_local_deleter( BOOST_SP_TYPEID_(local_sp_deleter<D>) ) ); } diff --git a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/weak_ptr.hpp b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/weak_ptr.hpp index 2022bce8d9..61ad971648 100644 --- a/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/weak_ptr.hpp +++ b/contrib/restricted/boost/smart_ptr/include/boost/smart_ptr/weak_ptr.hpp @@ -13,10 +13,8 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. // -#include <boost/smart_ptr/detail/requires_cxx11.hpp> #include <boost/smart_ptr/detail/shared_count.hpp> #include <boost/smart_ptr/shared_ptr.hpp> -#include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <memory> #include <cstddef> @@ -34,29 +32,24 @@ public: typedef typename boost::detail::sp_element< T >::type element_type; - BOOST_CONSTEXPR weak_ptr() BOOST_SP_NOEXCEPT : px(0), pn() + constexpr weak_ptr() noexcept : px(0), pn() { } // generated copy constructor, assignment, destructor are fine... - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - // ... except in C++0x, move disables the implicit copy - weak_ptr( weak_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + weak_ptr( weak_ptr const & r ) noexcept : px( r.px ), pn( r.pn ) { } - weak_ptr & operator=( weak_ptr const & r ) BOOST_SP_NOEXCEPT + weak_ptr & operator=( weak_ptr const & r ) noexcept { px = r.px; pn = r.pn; return *this; } -#endif - // // The "obvious" converting constructor implementation: // @@ -75,33 +68,15 @@ public: // template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) - -#else - - weak_ptr( weak_ptr<Y> const & r ) - -#endif - BOOST_SP_NOEXCEPT : px(r.lock().get()), pn(r.pn) + noexcept : px(r.lock().get()), pn(r.pn) { boost::detail::sp_assert_convertible< Y, T >(); } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) - -#else - - weak_ptr( weak_ptr<Y> && r ) - -#endif - BOOST_SP_NOEXCEPT : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) + noexcept : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) { boost::detail::sp_assert_convertible< Y, T >(); r.px = 0; @@ -109,57 +84,41 @@ public: // for better efficiency in the T == Y case weak_ptr( weak_ptr && r ) - BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) + noexcept : px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) { r.px = 0; } // for better efficiency in the T == Y case - weak_ptr & operator=( weak_ptr && r ) BOOST_SP_NOEXCEPT + weak_ptr & operator=( weak_ptr && r ) noexcept { this_type( static_cast< weak_ptr && >( r ) ).swap( *this ); return *this; } -#endif - template<class Y> -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) - -#else - - weak_ptr( shared_ptr<Y> const & r ) - -#endif - BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn ) + noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y, T >(); } // aliasing - template<class Y> weak_ptr(shared_ptr<Y> const & r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( r.pn ) + template<class Y> weak_ptr(shared_ptr<Y> const & r, element_type * p) noexcept: px( p ), pn( r.pn ) { } - template<class Y> weak_ptr(weak_ptr<Y> const & r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( r.pn ) + template<class Y> weak_ptr(weak_ptr<Y> const & r, element_type * p) noexcept: px( p ), pn( r.pn ) { } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - - template<class Y> weak_ptr(weak_ptr<Y> && r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( std::move( r.pn ) ) + template<class Y> weak_ptr(weak_ptr<Y> && r, element_type * p) noexcept: px( p ), pn( std::move( r.pn ) ) { } -#endif - -#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1300) - template<class Y> - weak_ptr & operator=( weak_ptr<Y> const & r ) BOOST_SP_NOEXCEPT + weak_ptr & operator=( weak_ptr<Y> const & r ) noexcept { boost::detail::sp_assert_convertible< Y, T >(); @@ -169,19 +128,15 @@ public: return *this; } -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template<class Y> - weak_ptr & operator=( weak_ptr<Y> && r ) BOOST_SP_NOEXCEPT + weak_ptr & operator=( weak_ptr<Y> && r ) noexcept { this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this ); return *this; } -#endif - template<class Y> - weak_ptr & operator=( shared_ptr<Y> const & r ) BOOST_SP_NOEXCEPT + weak_ptr & operator=( shared_ptr<Y> const & r ) noexcept { boost::detail::sp_assert_convertible< Y, T >(); @@ -191,92 +146,83 @@ public: return *this; } -#endif - - shared_ptr<T> lock() const BOOST_SP_NOEXCEPT + shared_ptr<T> lock() const noexcept { return shared_ptr<T>( *this, boost::detail::sp_nothrow_tag() ); } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pn.use_count(); } - bool expired() const BOOST_SP_NOEXCEPT + bool expired() const noexcept { return pn.use_count() == 0; } - bool _empty() const BOOST_SP_NOEXCEPT // extension, not in std::weak_ptr + bool _empty() const noexcept // extension, not in std::weak_ptr { return pn.empty(); } - bool empty() const BOOST_SP_NOEXCEPT // extension, not in std::weak_ptr + bool empty() const noexcept // extension, not in std::weak_ptr { return pn.empty(); } - void reset() BOOST_SP_NOEXCEPT + void reset() noexcept { this_type().swap(*this); } - void swap(this_type & other) BOOST_SP_NOEXCEPT + void swap(this_type & other) noexcept { std::swap(px, other.px); pn.swap(other.pn); } - template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const noexcept { return pn < rhs.pn; } - template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const noexcept { return pn < rhs.pn; } - template<class Y> bool owner_equals( weak_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_equals( weak_ptr<Y> const & rhs ) const noexcept { return pn == rhs.pn; } - template<class Y> bool owner_equals( shared_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT + template<class Y> bool owner_equals( shared_ptr<Y> const & rhs ) const noexcept { return pn == rhs.pn; } - std::size_t owner_hash_value() const BOOST_SP_NOEXCEPT + std::size_t owner_hash_value() const noexcept { return pn.hash_value(); } -// Tasteless as this may seem, making all members public allows member templates -// to work in the absence of member template friends. (Matthew Langston) - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - private: template<class Y> friend class weak_ptr; template<class Y> friend class shared_ptr; -#endif - element_type * px; // contained pointer boost::detail::weak_count pn; // reference counter }; // weak_ptr -template<class T, class U> inline bool operator<(weak_ptr<T> const & a, weak_ptr<U> const & b) BOOST_SP_NOEXCEPT +template<class T, class U> inline bool operator<(weak_ptr<T> const & a, weak_ptr<U> const & b) noexcept { return a.owner_before( b ); } -template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) BOOST_SP_NOEXCEPT +template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) noexcept { a.swap(b); } @@ -289,7 +235,7 @@ template<class T> weak_ptr( shared_ptr<T> ) -> weak_ptr<T>; // hash_value -template< class T > std::size_t hash_value( boost::weak_ptr<T> const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( boost::weak_ptr<T> const & p ) noexcept { return p.owner_hash_value(); } @@ -301,21 +247,17 @@ template< class T > std::size_t hash_value( boost::weak_ptr<T> const & p ) BOOST namespace std { -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - template<class T> struct hash< ::boost::weak_ptr<T> > { - std::size_t operator()( ::boost::weak_ptr<T> const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::boost::weak_ptr<T> const & p ) const noexcept { return p.owner_hash_value(); } }; -#endif // #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - template<class T> struct equal_to< ::boost::weak_ptr<T> > { - bool operator()( ::boost::weak_ptr<T> const & a, ::boost::weak_ptr<T> const & b ) const BOOST_SP_NOEXCEPT + bool operator()( ::boost::weak_ptr<T> const & a, ::boost::weak_ptr<T> const & b ) const noexcept { return a.owner_equals( b ); } diff --git a/contrib/restricted/boost/smart_ptr/ya.make b/contrib/restricted/boost/smart_ptr/ya.make index 0d8a683580..b3779839c4 100644 --- a/contrib/restricted/boost/smart_ptr/ya.make +++ b/contrib/restricted/boost/smart_ptr/ya.make @@ -6,18 +6,15 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.86.0) +VERSION(1.87.0) -ORIGINAL_SOURCE(https://github.com/boostorg/smart_ptr/archive/boost-1.86.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/smart_ptr/archive/boost-1.87.0.tar.gz) PEERDIR( contrib/restricted/boost/assert contrib/restricted/boost/config contrib/restricted/boost/core - contrib/restricted/boost/move - contrib/restricted/boost/static_assert contrib/restricted/boost/throw_exception - contrib/restricted/boost/type_traits ) ADDINCL( |