mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-04 19:51:02 +02:00
Compare commits
14 Commits
boost-1.72
...
feature/de
Author | SHA1 | Date | |
---|---|---|---|
|
7b9a969215 | ||
|
91cd83e5bf | ||
|
2fdb8c4b0a | ||
|
e806b53433 | ||
|
e0c7bd9a7e | ||
|
766ab05a12 | ||
|
05cbefd28e | ||
|
bfbdf4f45f | ||
|
169c0cd52a | ||
|
7d70691a16 | ||
|
90c27d7cfa | ||
|
43d1fe12c5 | ||
|
a2749dddb4 | ||
|
a71e62146c |
92
.travis.yml
92
.travis.yml
@@ -1,12 +1,10 @@
|
||||
# Copyright 2016-2019 Peter Dimov
|
||||
# Copyright 2016-2020 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
|
||||
branches:
|
||||
only:
|
||||
@@ -25,8 +23,19 @@ matrix:
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
arch: arm64
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11,14
|
||||
|
||||
- os: linux
|
||||
arch: ppc64le
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11,14
|
||||
|
||||
- os: linux
|
||||
arch: s390x
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11,14
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.4
|
||||
@@ -158,10 +167,7 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||
addons:
|
||||
@@ -170,6 +176,7 @@ matrix:
|
||||
- clang-3.3
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||
addons:
|
||||
@@ -179,15 +186,13 @@ matrix:
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.5
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.6
|
||||
@@ -198,7 +203,6 @@ matrix:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
@@ -209,7 +213,6 @@ matrix:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
@@ -218,10 +221,8 @@ matrix:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
@@ -230,10 +231,8 @@ matrix:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
@@ -244,7 +243,6 @@ matrix:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
@@ -255,7 +253,6 @@ matrix:
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
@@ -266,7 +263,6 @@ matrix:
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
@@ -277,7 +273,7 @@ matrix:
|
||||
- clang-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-7
|
||||
- llvm-toolchain-xenial-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
@@ -288,21 +284,34 @@ matrix:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-8
|
||||
- llvm-toolchain-xenial-8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
|
||||
dist: xenial
|
||||
compiler: clang++-9
|
||||
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
- libstdc++-5-dev
|
||||
- clang-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-7
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-8
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: clang++-libc++
|
||||
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
@@ -311,6 +320,7 @@ matrix:
|
||||
- libc++-dev
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: clang++-libc++
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||
addons:
|
||||
@@ -322,6 +332,17 @@ matrix:
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_TEST=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=smart_ptr -DBUILD_TESTING=ON ..
|
||||
- ctest --output-on-failure -R boost_smart_ptr
|
||||
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: CMAKE_SUBDIR_TEST=1
|
||||
@@ -331,6 +352,17 @@ matrix:
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_INSTALL_TEST=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=smart_ptr -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build . --target install
|
||||
- cd ../libs/smart_ptr/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
@@ -352,7 +384,9 @@ install:
|
||||
- git submodule init tools/build
|
||||
- git submodule init libs/headers
|
||||
- git submodule init tools/boost_install
|
||||
- git submodule update --jobs 3
|
||||
- git submodule init tools/cmake
|
||||
- git submodule init libs/preprocessor
|
||||
- git submodule update # no --jobs 3 on non-amd64
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/smart_ptr
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
@@ -1,12 +1,10 @@
|
||||
# Copyright 2018 Mike Dev
|
||||
# Copyright 2018-2020 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
|
||||
|
||||
# Partial (add_subdirectory only) and experimental CMake support
|
||||
# Subject to change; please do not rely on the contents of this file yet
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(BoostSmartPtr LANGUAGES CXX)
|
||||
project(boost_smart_ptr VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
add_library(boost_smart_ptr INTERFACE)
|
||||
add_library(Boost::smart_ptr ALIAS boost_smart_ptr)
|
||||
@@ -19,8 +17,20 @@ target_link_libraries(boost_smart_ptr
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::move
|
||||
Boost::predef
|
||||
Boost::static_assert
|
||||
Boost::throw_exception
|
||||
Boost::type_traits
|
||||
)
|
||||
|
||||
if(BOOST_SUPERPROJECT_VERSION)
|
||||
|
||||
include(BoostInstall)
|
||||
boost_install(TARGETS boost_smart_ptr HEADER_DIRECTORY include/)
|
||||
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
||||
endif()
|
||||
|
10
appveyor.yml
10
appveyor.yml
@@ -20,7 +20,15 @@ environment:
|
||||
TOOLSET: msvc-12.0,msvc-14.0
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1,clang-win
|
||||
TOOLSET: msvc-14.1
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: clang-win
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: msvc-14.2
|
||||
CXXSTD: 14,17
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
|
@@ -106,7 +106,7 @@ template<class T>
|
||||
+
|
||||
Constraints:: `T` is not an array.
|
||||
Returns:: `std::unique_ptr<T>(new T)`.
|
||||
Example:: `auto p = make_unique_noinit<double[1024]>();`
|
||||
Example:: `auto p = make_unique_noinit<std::array<double, 1024> >();`
|
||||
|
||||
```
|
||||
template<class T>
|
||||
|
@@ -28,15 +28,12 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_HAS_THREADS)
|
||||
# include <boost/smart_ptr/detail/lwm_nop.hpp>
|
||||
#elif defined(BOOST_HAS_PTHREADS)
|
||||
# include <boost/smart_ptr/detail/lwm_pthreads.hpp>
|
||||
#elif defined(BOOST_HAS_WINTHREADS) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
#if !defined(BOOST_NO_CXX11_HDR_MUTEX )
|
||||
# include <boost/smart_ptr/detail/lwm_std_mutex.hpp>
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/lwm_win32_cs.hpp>
|
||||
#else
|
||||
// Use #define BOOST_DISABLE_THREADS to avoid the error
|
||||
# error Unrecognized threading platform
|
||||
# include <boost/smart_ptr/detail/lwm_pthreads.hpp>
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
|
||||
|
@@ -1,37 +0,0 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_LWM_NOP_HPP_INCLUDED
|
||||
#define BOOST_SMART_PTR_DETAIL_LWM_NOP_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/lwm_nop.hpp
|
||||
//
|
||||
// Copyright (c) 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)
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
public:
|
||||
|
||||
typedef lightweight_mutex scoped_lock;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_LWM_NOP_HPP_INCLUDED
|
62
include/boost/smart_ptr/detail/lwm_std_mutex.hpp
Normal file
62
include/boost/smart_ptr/detail/lwm_std_mutex.hpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_LWM_STD_MUTEX_HPP_INCLUDED
|
||||
#define BOOST_SMART_PTR_DETAIL_LWM_STD_MUTEX_HPP_INCLUDED
|
||||
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <mutex>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
std::mutex m_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex()
|
||||
{
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
std::mutex & m_;
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
scoped_lock( lightweight_mutex & m ): m_( m.m_ )
|
||||
{
|
||||
m_.lock();
|
||||
}
|
||||
|
||||
~scoped_lock()
|
||||
{
|
||||
m_.unlock();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_LWM_STD_MUTEX_HPP_INCLUDED
|
@@ -11,15 +11,12 @@
|
||||
// boost/detail/lwm_win32_cs.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov
|
||||
// Copyright (c) Microsoft Corporation 2014
|
||||
//
|
||||
// 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/predef.h>
|
||||
|
||||
#ifdef BOOST_USE_WINDOWS_H
|
||||
|
||||
#include <windows.h>
|
||||
@@ -52,11 +49,7 @@ struct critical_section
|
||||
#endif
|
||||
};
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSectionEx(::_RTL_CRITICAL_SECTION *, unsigned long, unsigned long);
|
||||
#else
|
||||
extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(::_RTL_CRITICAL_SECTION *);
|
||||
#endif
|
||||
extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRITICAL_SECTION *);
|
||||
extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
|
||||
extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
|
||||
@@ -67,11 +60,7 @@ typedef ::_RTL_CRITICAL_SECTION rtl_critical_section;
|
||||
|
||||
typedef ::CRITICAL_SECTION critical_section;
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
using ::InitializeCriticalSectionEx;
|
||||
#else
|
||||
using ::InitializeCriticalSection;
|
||||
#endif
|
||||
using ::EnterCriticalSection;
|
||||
using ::LeaveCriticalSection;
|
||||
using ::DeleteCriticalSection;
|
||||
@@ -93,11 +82,7 @@ public:
|
||||
|
||||
lightweight_mutex()
|
||||
{
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
boost::detail::InitializeCriticalSectionEx(reinterpret_cast< rtl_critical_section* >(&cs_), 4000, 0);
|
||||
#else
|
||||
boost::detail::InitializeCriticalSection(reinterpret_cast< rtl_critical_section* >(&cs_));
|
||||
#endif
|
||||
}
|
||||
|
||||
~lightweight_mutex()
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <boost/smart_ptr/detail/sp_interlocked.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
|
@@ -11,7 +11,6 @@
|
||||
// yield_k.hpp
|
||||
//
|
||||
// Copyright (c) 2008 Peter Dimov
|
||||
// Copyright (c) Microsoft Corporation 2014
|
||||
//
|
||||
// void yield( unsigned k );
|
||||
//
|
||||
@@ -25,11 +24,6 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/predef/platform/windows_runtime.h>
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
#include <thread>
|
||||
#endif
|
||||
|
||||
// BOOST_SMT_PAUSE
|
||||
|
||||
@@ -59,7 +53,7 @@ namespace boost
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME
|
||||
#if !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
#if defined(__clang__) && defined(__x86_64__)
|
||||
// clang x64 warns that __stdcall is ignored
|
||||
@@ -76,7 +70,7 @@ namespace detail
|
||||
|
||||
#undef BOOST_SP_STDCALL
|
||||
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME
|
||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
inline void yield( unsigned k ) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -89,7 +83,6 @@ inline void yield( unsigned k ) BOOST_NOEXCEPT
|
||||
BOOST_SMT_PAUSE
|
||||
}
|
||||
#endif
|
||||
#if !BOOST_PLAT_WINDOWS_RUNTIME
|
||||
else if( k < 32 )
|
||||
{
|
||||
Sleep( 0 );
|
||||
@@ -98,13 +91,6 @@ inline void yield( unsigned k ) BOOST_NOEXCEPT
|
||||
{
|
||||
Sleep( 1 );
|
||||
}
|
||||
#else
|
||||
else
|
||||
{
|
||||
// Sleep isn't supported on the Windows Runtime.
|
||||
std::this_thread::yield();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/detail/workaround.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>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#include <cstddef> // for std::ptrdiff_t
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#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/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
# include <memory> // for std::auto_ptr
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#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/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#include <cstddef> // for std::ptrdiff_t
|
||||
#include <algorithm> // for std::swap
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/smart_ptr/detail/shared_count.hpp>
|
||||
#include <boost/detail/workaround.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_disable_deprecated.hpp>
|
||||
@@ -1175,6 +1175,13 @@ template<class D, class T> D const * basic_get_local_deleter( D const *, shared_
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if defined(__cpp_deduction_guides)
|
||||
|
||||
template<class T> shared_ptr( weak_ptr<T> ) -> shared_ptr<T>;
|
||||
template<class T, class D> shared_ptr( std::unique_ptr<T, D> ) -> shared_ptr<T>;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if defined( BOOST_SP_DISABLE_DEPRECATED )
|
||||
|
@@ -264,6 +264,12 @@ template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) BOOST_SP_NOEXCEPT
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
#if defined(__cpp_deduction_guides)
|
||||
|
||||
template<class T> weak_ptr( shared_ptr<T> ) -> weak_ptr<T>;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_WEAK_PTR_HPP_INCLUDED
|
||||
|
15
test/CMakeLists.txt
Normal file
15
test/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2018, 2019 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(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
||||
|
||||
if(HAVE_BOOST_TEST)
|
||||
|
||||
# for lw_thread_test.cpp
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
|
||||
boost_test_jamfile(FILE Jamfile LINK_LIBRARIES Boost::smart_ptr Boost::core Boost::align Boost::atomic Boost::container_hash Threads::Threads)
|
||||
|
||||
endif()
|
61
test/Jamfile
61
test/Jamfile
@@ -57,7 +57,8 @@ run yield_k_test.cpp : : : <threading>multi : yield_k_test.mt ;
|
||||
run spinlock_test.cpp ;
|
||||
run spinlock_try_test.cpp ;
|
||||
run spinlock_try_test.cpp : : : <threading>multi : spinlock_try_test.mt ;
|
||||
run spinlock_pool_test.cpp : : :
|
||||
run spinlock_pool_test.cpp
|
||||
: : :
|
||||
# msvc-8.0, 9.0 optimizer codegen bug for `x % 41`
|
||||
<toolset>msvc-8.0,<variant>release:<build>no
|
||||
<toolset>msvc-9.0,<variant>release:<build>no ;
|
||||
@@ -78,7 +79,10 @@ run sp_recursive_assign_test.cpp ;
|
||||
run sp_recursive_assign2_test.cpp ;
|
||||
run sp_recursive_assign_rv_test.cpp ;
|
||||
run sp_recursive_assign2_rv_test.cpp ;
|
||||
compile-fail auto_ptr_lv_fail.cpp : <toolset>gcc-4.4.7:<build>no ;
|
||||
|
||||
compile-fail auto_ptr_lv_fail.cpp
|
||||
: <toolset>gcc-4.4.7:<build>no ;
|
||||
|
||||
run atomic_count_test2.cpp ;
|
||||
run sp_typeinfo_test.cpp ;
|
||||
compile make_shared_fp_test.cpp ;
|
||||
@@ -158,23 +162,33 @@ compile-fail array_fail_dereference.cpp ;
|
||||
compile-fail array_fail_member_access.cpp ;
|
||||
compile-fail array_fail_array_access.cpp ;
|
||||
|
||||
run make_shared_array_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_arrays_test.cpp ; # <cxxflags>-fno-deduce-init-list no longer needed for gcc-4.6
|
||||
run make_shared_array_throws_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_esft_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_noinit_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_value_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_arrays_test.cpp ;
|
||||
run make_shared_array_throws_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_esft_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_noinit_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_value_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_test.cpp ;
|
||||
run allocate_shared_arrays_test.cpp ; # <cxxflags>-fno-deduce-init-list no longer needed for gcc-4.6
|
||||
run allocate_shared_array_throws_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_esft_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_noinit_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_value_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_arrays_test.cpp ;
|
||||
run allocate_shared_array_throws_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_esft_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_noinit_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_value_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
run allocate_shared_array_construct_test.cpp ;
|
||||
|
||||
run make_unique_test.cpp ;
|
||||
run make_unique_args_test.cpp ;
|
||||
run make_unique_value_test.cpp : : : <toolset>gcc-4.6:<cxxflags>-fno-deduce-init-list ;
|
||||
run make_unique_value_test.cpp
|
||||
: : : <toolset>gcc-4.6:<cxxflags>-fno-deduce-init-list ;
|
||||
run make_unique_noinit_test.cpp ;
|
||||
run make_unique_throws_test.cpp ;
|
||||
run make_unique_array_test.cpp ;
|
||||
@@ -236,7 +250,8 @@ run shared_ptr_fn_test.cpp ;
|
||||
run get_deleter_test2.cpp ;
|
||||
run get_deleter_test3.cpp ;
|
||||
run get_deleter_array_test2.cpp ;
|
||||
run get_deleter_array_test3.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run get_deleter_array_test3.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
|
||||
run sp_convertible_test2.cpp ;
|
||||
|
||||
@@ -258,13 +273,15 @@ run allocate_local_shared_test.cpp ;
|
||||
run allocate_local_shared_esft_test.cpp ;
|
||||
|
||||
run make_local_shared_array_test.cpp ;
|
||||
run make_local_shared_arrays_test.cpp : : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
||||
run make_local_shared_arrays_test.cpp
|
||||
: : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
||||
run make_local_shared_array_throws_test.cpp ;
|
||||
run make_local_shared_array_esft_test.cpp ;
|
||||
run make_local_shared_array_noinit_test.cpp ;
|
||||
run make_local_shared_array_value_test.cpp ;
|
||||
run allocate_local_shared_array_test.cpp ;
|
||||
run allocate_local_shared_arrays_test.cpp : : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
||||
run allocate_local_shared_arrays_test.cpp
|
||||
: : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
||||
run allocate_local_shared_array_throws_test.cpp ;
|
||||
run allocate_local_shared_array_esft_test.cpp ;
|
||||
run allocate_local_shared_array_noinit_test.cpp ;
|
||||
@@ -275,9 +292,11 @@ run local_sp_fn_test.cpp ;
|
||||
run lsp_convertible_test.cpp ;
|
||||
run lsp_convertible_test2.cpp ;
|
||||
|
||||
run make_shared_array_tmp_test.cpp : : : <toolset>msvc-8.0:<build>no ;
|
||||
run make_shared_array_tmp_test.cpp
|
||||
: : : <toolset>msvc-8.0:<build>no ;
|
||||
|
||||
run lw_thread_test.cpp : : : <threading>multi ;
|
||||
run lw_thread_test.cpp
|
||||
: : : <threading>multi ;
|
||||
|
||||
compile sp_windows_h_test.cpp ;
|
||||
compile spinlock_windows_h_test.cpp ;
|
||||
@@ -333,3 +352,7 @@ run allocate_unique_noinit_test.cpp ;
|
||||
run allocate_unique_test.cpp ;
|
||||
run allocate_unique_throws_test.cpp ;
|
||||
run allocate_unique_value_test.cpp ;
|
||||
|
||||
run sp_guides_test.cpp ;
|
||||
run sp_guides_test2.cpp ;
|
||||
run wp_guides_test.cpp ;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@ int main()
|
||||
#else
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
|
||||
struct X
|
||||
|
18
test/cmake_install_test/CMakeLists.txt
Normal file
18
test/cmake_install_test/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2018, 2019 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
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
find_package(boost_smart_ptr REQUIRED)
|
||||
find_package(boost_core REQUIRED)
|
||||
|
||||
add_executable(quick ../quick.cpp)
|
||||
target_link_libraries(quick Boost::smart_ptr Boost::core)
|
||||
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
@@ -2,7 +2,7 @@
|
||||
# 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
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
@@ -11,7 +11,6 @@ add_subdirectory(../../../assert boostorg/assert)
|
||||
add_subdirectory(../../../config boostorg/config)
|
||||
add_subdirectory(../../../core boostorg/core)
|
||||
add_subdirectory(../../../move boostorg/move)
|
||||
add_subdirectory(../../../predef boostorg/predef)
|
||||
add_subdirectory(../../../static_assert boostorg/static_assert)
|
||||
add_subdirectory(../../../throw_exception boostorg/throw_exception)
|
||||
add_subdirectory(../../../type_traits boostorg/type_traits)
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <boost/pointer_cast.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_array.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct deleter
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct deleter
|
||||
{
|
||||
|
@@ -26,7 +26,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstddef>
|
||||
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
namespace N1 {
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
|
||||
//
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class base
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
|
||||
#include <boost/detail/lightweight_thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/detail/atomic_count.hpp>
|
||||
|
||||
boost::detail::atomic_count count( 0 );
|
||||
|
@@ -8,7 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_local_shared.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -8,7 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_local_shared.hpp>
|
||||
|
||||
int main()
|
||||
|
@@ -5,7 +5,7 @@ Copyright 2012-2015 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -5,7 +5,7 @@ Copyright 2012-2015 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
int main()
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/move/utility_core.hpp>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
class type {
|
||||
|
@@ -7,7 +7,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
*/
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
struct type {
|
||||
|
@@ -11,7 +11,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/owner_less.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_array.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <boost/smart_ptr/enable_shared_from_raw.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <boost/smart_ptr/enable_shared_from_raw.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <boost/smart_ptr/enable_shared_from_raw.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/smart_ptr/enable_shared_from_raw.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <boost/smart_ptr/enable_shared_from_raw.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
|
||||
class X: public boost::enable_shared_from_raw
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <utility>
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
|
@@ -28,7 +28,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
//
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct X
|
||||
{};
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
|
@@ -28,7 +28,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <boost/smart_ptr.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/memory_order.hpp>
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/move/unique_ptr.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <memory>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#define HAVE_CONSTEXPR_INIT
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#define HAVE_CONSTEXPR_INIT
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_convertible.hpp>
|
||||
|
||||
//
|
||||
|
25
test/sp_guides_test.cpp
Normal file
25
test/sp_guides_test.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#if defined(__cpp_deduction_guides)
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::shared_ptr<int> p1( new int );
|
||||
boost::weak_ptr<int> p2( p1 );
|
||||
boost::shared_ptr p3( p2 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test because __cpp_deduction_guides is not defined" )
|
||||
|
||||
int main() {}
|
||||
|
||||
#endif
|
23
test/sp_guides_test2.cpp
Normal file
23
test/sp_guides_test2.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#if defined(__cpp_deduction_guides)
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::shared_ptr p2( std::unique_ptr<int>( new int ) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test because __cpp_deduction_guides is not defined" )
|
||||
|
||||
int main() {}
|
||||
|
||||
#endif
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
||||
|
||||
#include <boost/smart_ptr/detail/sp_interlocked.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#ifndef __LP64__
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user