mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-05 04:01:04 +02:00
Compare commits
47 Commits
boost-1.65
...
boost-1.67
Author | SHA1 | Date | |
---|---|---|---|
|
605d4a2789 | ||
|
6ab9b93088 | ||
|
4129bb6a5c | ||
|
3b64e5ecb3 | ||
|
4025698fe8 | ||
|
2d7ab197a7 | ||
|
5877b08490 | ||
|
ffe5b46f75 | ||
|
4abc74fe28 | ||
|
12a646c607 | ||
|
937a3e0e93 | ||
|
258fa75a7e | ||
|
93d0d69f5e | ||
|
f173f9c0fb | ||
|
6a5942f55f | ||
|
293a4ee009 | ||
|
8e3aa3a565 | ||
|
78bebd5166 | ||
|
a47cf35b0f | ||
|
8d0afb670f | ||
|
77a35856c6 | ||
|
693109361e | ||
|
6735806863 | ||
|
b0dc300154 | ||
|
adc998469a | ||
|
4252ed31de | ||
|
279372a784 | ||
|
b77b7cfd62 | ||
|
2553a71b79 | ||
|
5dfcd2a6e4 | ||
|
6f30b395e4 | ||
|
014318a1ba | ||
|
d2c8eea08d | ||
|
4e0d47302b | ||
|
765840cd71 | ||
|
cb4a878fa8 | ||
|
57a585ed46 | ||
|
949338ff18 | ||
|
50fbbe91d8 | ||
|
e88227b506 | ||
|
410f2ce8d4 | ||
|
4e2e758f58 | ||
|
9cb8ee086f | ||
|
a054a570c1 | ||
|
219dc523ec | ||
|
5da882293d | ||
|
868a870a59 |
399
.travis.yml
399
.travis.yml
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2016, 2017 Peter Dimov
|
# Copyright 2016, 2017, 2018 Peter Dimov
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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)
|
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
@@ -6,10 +6,6 @@ language: cpp
|
|||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
@@ -28,21 +24,31 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++
|
compiler: g++
|
||||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 VARIANT=debug,release
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-4.7
|
compiler: g++-4.4
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- g++-4.7
|
- g++-4.4
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: g++-4.6
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-4.6
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-4.7
|
compiler: g++-4.7
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11
|
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -52,37 +58,16 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-4.8
|
compiler: g++-4.8
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-4.8
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-4.8
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-4.9
|
compiler: g++-4.9
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-4.9
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-4.9
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -92,37 +77,7 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-5
|
compiler: g++-5
|
||||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-5
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-5
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-5
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -132,7 +87,7 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-6
|
compiler: g++-6
|
||||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -141,39 +96,8 @@ matrix:
|
|||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++-6
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-6
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: g++-6
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: trusty
|
|
||||||
compiler: g++-7
|
compiler: g++-7
|
||||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++03
|
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 VARIANT=release
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -182,31 +106,8 @@ matrix:
|
|||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
|
||||||
compiler: g++-7
|
compiler: g++-7
|
||||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++11
|
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-7
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: trusty
|
|
||||||
compiler: g++-7
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-7
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: trusty
|
|
||||||
compiler: g++-7
|
|
||||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++17
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -216,92 +117,39 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 VARIANT=debug,release
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++
|
compiler: /usr/bin/clang++
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.3
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: /usr/bin/clang++
|
||||||
|
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-3.4
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-3.5
|
compiler: clang++-3.5
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.5
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.5
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.5
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.5
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.5
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.5
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.5
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-3.5
|
- clang-3.5
|
||||||
|
- libstdc++-4.9-dev
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.5
|
- llvm-toolchain-precise-3.5
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-3.6
|
compiler: clang++-3.6
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.6
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.6
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.6
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.6
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.6
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.6
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.6
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -312,40 +160,7 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-3.7
|
compiler: clang++-3.7
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.7
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.7
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.7
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.7
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.7
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.7
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.7
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.7
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.7
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -356,95 +171,31 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-3.8
|
compiler: clang++-3.8
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.8
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.8
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.8
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.8
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.8
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.8
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.8
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.8
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.8
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-3.8
|
- clang-3.8
|
||||||
|
- libstdc++-4.9-dev
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.8
|
- llvm-toolchain-precise-3.8
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.9
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.9
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.9
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.9
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.9
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.9
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.9
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.9
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: clang++-3.9
|
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-3.9
|
- clang-3.9
|
||||||
|
- libstdc++-4.9-dev
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-precise-3.9
|
- llvm-toolchain-precise-3.9
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-4.0
|
compiler: clang++-4.0
|
||||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -454,53 +205,46 @@ matrix:
|
|||||||
- llvm-toolchain-trusty-4.0
|
- llvm-toolchain-trusty-4.0
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-4.0
|
compiler: clang++-5.0
|
||||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++11
|
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z VARIANT=release
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-4.0
|
- clang-5.0
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-trusty-4.0
|
- llvm-toolchain-trusty-5.0
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-4.0
|
compiler: clang++-5.0
|
||||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++14
|
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-4.0
|
- clang-5.0
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-trusty-4.0
|
- llvm-toolchain-trusty-5.0
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++-4.0
|
compiler: clang++-libc++
|
||||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++1z
|
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z VARIANT=release
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- clang-4.0
|
- libc++-dev
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
- os: linux
|
||||||
- llvm-toolchain-trusty-4.0
|
compiler: clang++-libc++
|
||||||
|
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libc++-dev
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||||
|
|
||||||
- os: osx
|
|
||||||
compiler: clang++
|
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
compiler: clang++
|
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
compiler: clang++
|
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||||
@@ -511,16 +255,15 @@ install:
|
|||||||
- git submodule init libs/assert
|
- git submodule init libs/assert
|
||||||
- git submodule init libs/atomic
|
- git submodule init libs/atomic
|
||||||
- git submodule init libs/config
|
- git submodule init libs/config
|
||||||
|
- git submodule init libs/container_hash
|
||||||
- git submodule init libs/core
|
- git submodule init libs/core
|
||||||
- git submodule init libs/detail
|
|
||||||
- git submodule init libs/functional
|
|
||||||
- git submodule init libs/integer
|
|
||||||
- git submodule init libs/move
|
- git submodule init libs/move
|
||||||
- git submodule init libs/predef
|
- git submodule init libs/predef
|
||||||
- git submodule init libs/preprocessor
|
|
||||||
- git submodule init libs/static_assert
|
- git submodule init libs/static_assert
|
||||||
- git submodule init libs/throw_exception
|
- git submodule init libs/throw_exception
|
||||||
- git submodule init libs/type_traits
|
- git submodule init libs/type_traits
|
||||||
|
- git submodule init libs/detail
|
||||||
|
- git submodule init libs/integer
|
||||||
- git submodule init tools/build
|
- git submodule init tools/build
|
||||||
- git submodule update
|
- git submodule update
|
||||||
- cp -r $TRAVIS_BUILD_DIR/* libs/smart_ptr
|
- cp -r $TRAVIS_BUILD_DIR/* libs/smart_ptr
|
||||||
@@ -529,8 +272,8 @@ install:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- |-
|
- |-
|
||||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||||
- ./b2 libs/smart_ptr/test toolset=$TOOLSET
|
- ./b2 -j3 libs/smart_ptr/test toolset=$TOOLSET cxxstd=$CXXSTD ${VARIANT:+variant=$VARIANT} ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined debug-symbols=on}
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
Branch | Travis | Appveyor
|
Branch | Travis | Appveyor
|
||||||
---------|--------|---------
|
---------|--------|---------
|
||||||
Develop | [](https://travis-ci.org/boostorg/smart_ptr) | [](https://ci.appveyor.com/project/pdimov/smart_ptr)
|
Develop | [](https://travis-ci.org/boostorg/smart_ptr) | [](https://ci.appveyor.com/project/pdimov/smart-ptr)
|
||||||
Master | [](https://travis-ci.org/boostorg/smart_ptr) | [](https://ci.appveyor.com/project/pdimov/smart_ptr)
|
Master | [](https://travis-ci.org/boostorg/smart_ptr) | [](https://ci.appveyor.com/project/pdimov/smart-ptr)
|
||||||
|
21
appveyor.yml
21
appveyor.yml
@@ -15,17 +15,12 @@ branches:
|
|||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
TOOLSET: msvc-9.0
|
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
|
||||||
TOOLSET: msvc-10.0
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
|
||||||
TOOLSET: msvc-11.0
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
|
||||||
TOOLSET: msvc-12.0
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-14.0
|
TOOLSET: msvc-14.0
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
TOOLSET: msvc-14.1
|
TOOLSET: msvc-14.1
|
||||||
|
CXXSTD: 14,17
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- set BOOST_BRANCH=develop
|
- set BOOST_BRANCH=develop
|
||||||
@@ -37,23 +32,23 @@ install:
|
|||||||
- git submodule init libs/assert
|
- git submodule init libs/assert
|
||||||
- git submodule init libs/atomic
|
- git submodule init libs/atomic
|
||||||
- git submodule init libs/config
|
- git submodule init libs/config
|
||||||
|
- git submodule init libs/container_hash
|
||||||
- git submodule init libs/core
|
- git submodule init libs/core
|
||||||
- git submodule init libs/detail
|
|
||||||
- git submodule init libs/functional
|
|
||||||
- git submodule init libs/integer
|
|
||||||
- git submodule init libs/move
|
- git submodule init libs/move
|
||||||
- git submodule init libs/predef
|
- git submodule init libs/predef
|
||||||
- git submodule init libs/preprocessor
|
|
||||||
- git submodule init libs/static_assert
|
- git submodule init libs/static_assert
|
||||||
- git submodule init libs/throw_exception
|
- git submodule init libs/throw_exception
|
||||||
- git submodule init libs/type_traits
|
- git submodule init libs/type_traits
|
||||||
|
- git submodule init libs/detail
|
||||||
|
- git submodule init libs/integer
|
||||||
- git submodule init tools/build
|
- git submodule init tools/build
|
||||||
- git submodule update
|
- git submodule update
|
||||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\smart_ptr
|
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\smart_ptr
|
||||||
- cmd /c bootstrap
|
- cmd /c bootstrap
|
||||||
- b2 headers
|
- b2 -d0 headers
|
||||||
|
|
||||||
build: off
|
build: off
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- b2 libs/smart_ptr/test toolset=%TOOLSET%
|
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||||
|
- b2 -j3 libs/smart_ptr/test toolset=%TOOLSET% %CXXSTD% variant=debug,release
|
||||||
|
@@ -1,50 +0,0 @@
|
|||||||
# Copyright 2017 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)
|
|
||||||
|
|
||||||
import type ;
|
|
||||||
import scanner ;
|
|
||||||
import generators ;
|
|
||||||
import boostbook ;
|
|
||||||
|
|
||||||
# File type
|
|
||||||
|
|
||||||
type.register ASCIIDOC : asciidoc adoc ;
|
|
||||||
|
|
||||||
# Define dependency scanner
|
|
||||||
|
|
||||||
class asciidoc-scanner : common-scanner
|
|
||||||
{
|
|
||||||
rule pattern ( )
|
|
||||||
{
|
|
||||||
return "include::([^[]+)\\[" ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scanner.register asciidoc-scanner : include ;
|
|
||||||
type.set-scanner ASCIIDOC : asciidoc-scanner ;
|
|
||||||
|
|
||||||
# Define generators
|
|
||||||
|
|
||||||
generators.register-standard asciidoctor.asciidoc-to-html : ASCIIDOC : HTML ;
|
|
||||||
generators.register-standard asciidoctor.asciidoc-to-pdf : ASCIIDOC : PDF ;
|
|
||||||
# generators.register-standard asciidoctor.asciidoc-to-docbook : ASCIIDOC : DOCBOOK ;
|
|
||||||
|
|
||||||
# Define actions
|
|
||||||
|
|
||||||
actions asciidoc-to-html
|
|
||||||
{
|
|
||||||
asciidoctor -b html -o $(1) $(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
actions asciidoc-to-pdf
|
|
||||||
{
|
|
||||||
asciidoctor -r asciidoctor-pdf -b pdf -o $(1) $(2)
|
|
||||||
}
|
|
||||||
|
|
||||||
actions asciidoc-to-docbook
|
|
||||||
{
|
|
||||||
asciidoctor -b docbook -o $(1) $(2)
|
|
||||||
}
|
|
@@ -155,7 +155,7 @@ template<class Y> intrusive_ptr(intrusive_ptr<Y> const & r);
|
|||||||
[none]
|
[none]
|
||||||
* {blank}
|
* {blank}
|
||||||
+
|
+
|
||||||
Effects:: `if(r.get() != 0) intrusive_ptr_add_ref(r.get());`.
|
Effects:: `T * p = r.get(); if(p != 0) intrusive_ptr_add_ref(p);`.
|
||||||
Postconditions:: `get() == r.get()`.
|
Postconditions:: `get() == r.get()`.
|
||||||
|
|
||||||
### destructor
|
### destructor
|
||||||
|
@@ -35,7 +35,7 @@ feature with `std::make_unique`.
|
|||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
`make_unique` is defined in `<boost/smart_ptr/make_unqiue.hpp>`.
|
`make_unique` is defined in `<boost/smart_ptr/make_unique.hpp>`.
|
||||||
|
|
||||||
[subs=+quotes]
|
[subs=+quotes]
|
||||||
```
|
```
|
||||||
|
@@ -77,8 +77,16 @@ public:
|
|||||||
|
|
||||||
extern "C" void * lw_thread_routine( void * pv )
|
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 ) );
|
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();
|
pt->run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -88,8 +96,16 @@ extern "C" void * lw_thread_routine( void * pv )
|
|||||||
|
|
||||||
unsigned __stdcall 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 ) );
|
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();
|
pt->run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -117,8 +133,16 @@ private:
|
|||||||
|
|
||||||
template<class F> int lw_thread_create( pthread_t & pt, F f )
|
template<class F> int lw_thread_create( pthread_t & pt, F f )
|
||||||
{
|
{
|
||||||
|
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
|
||||||
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
|
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 = pthread_create( &pt, 0, lw_thread_routine, p.get() );
|
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
|
||||||
|
|
||||||
if( r == 0 )
|
if( r == 0 )
|
||||||
|
@@ -175,7 +175,8 @@ sp_array_destroy(A& allocator, T* start, std::size_t size)
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
boost::has_trivial_constructor<T>::value &&
|
boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value>::type
|
||||||
sp_array_construct(A&, T* start, std::size_t size)
|
sp_array_construct(A&, T* start, std::size_t size)
|
||||||
{
|
{
|
||||||
for (std::size_t i = 0; i < size; ++i) {
|
for (std::size_t i = 0; i < size; ++i) {
|
||||||
@@ -186,7 +187,8 @@ sp_array_construct(A&, T* start, std::size_t size)
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
boost::has_trivial_constructor<T>::value &&
|
boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value>::type
|
||||||
sp_array_construct(A&, T* start, std::size_t size, const T* list,
|
sp_array_construct(A&, T* start, std::size_t size, const T* list,
|
||||||
std::size_t count)
|
std::size_t count)
|
||||||
{
|
{
|
||||||
@@ -199,7 +201,8 @@ sp_array_construct(A&, T* start, std::size_t size, const T* list,
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
!(boost::has_trivial_constructor<T>::value &&
|
!(boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value)>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value)>::type
|
||||||
sp_array_construct(A& none, T* start, std::size_t size)
|
sp_array_construct(A& none, T* start, std::size_t size)
|
||||||
{
|
{
|
||||||
std::size_t i = 0;
|
std::size_t i = 0;
|
||||||
@@ -216,7 +219,8 @@ sp_array_construct(A& none, T* start, std::size_t size)
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
!(boost::has_trivial_constructor<T>::value &&
|
!(boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value)>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value)>::type
|
||||||
sp_array_construct(A& none, T* start, std::size_t size, const T* list,
|
sp_array_construct(A& none, T* start, std::size_t size, const T* list,
|
||||||
std::size_t count)
|
std::size_t count)
|
||||||
{
|
{
|
||||||
@@ -234,7 +238,8 @@ sp_array_construct(A& none, T* start, std::size_t size, const T* list,
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
!(boost::has_trivial_constructor<T>::value &&
|
!(boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value)>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value)>::type
|
||||||
sp_array_construct(A&, T* start, std::size_t size)
|
sp_array_construct(A&, T* start, std::size_t size)
|
||||||
{
|
{
|
||||||
for (std::size_t i = 0; i < size; ++i) {
|
for (std::size_t i = 0; i < size; ++i) {
|
||||||
@@ -245,7 +250,8 @@ sp_array_construct(A&, T* start, std::size_t size)
|
|||||||
template<bool E, class A, class T>
|
template<bool E, class A, class T>
|
||||||
inline typename sp_enable<!E &&
|
inline typename sp_enable<!E &&
|
||||||
!(boost::has_trivial_constructor<T>::value &&
|
!(boost::has_trivial_constructor<T>::value &&
|
||||||
boost::has_trivial_assign<T>::value)>::type
|
boost::has_trivial_assign<T>::value &&
|
||||||
|
boost::has_trivial_destructor<T>::value)>::type
|
||||||
sp_array_construct(A&, T* start, std::size_t size, const T* list,
|
sp_array_construct(A&, T* start, std::size_t size, const T* list,
|
||||||
std::size_t count)
|
std::size_t count)
|
||||||
{
|
{
|
||||||
@@ -347,9 +353,9 @@ public:
|
|||||||
typedef A type;
|
typedef A type;
|
||||||
|
|
||||||
template<class U>
|
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) BOOST_SP_NOEXCEPT
|
||||||
: allocator_(allocator),
|
: allocator_(_allocator),
|
||||||
size_(size) { }
|
size_(_size) { }
|
||||||
|
|
||||||
A& allocator() BOOST_SP_NOEXCEPT {
|
A& allocator() BOOST_SP_NOEXCEPT {
|
||||||
return allocator_;
|
return allocator_;
|
||||||
@@ -370,8 +376,8 @@ public:
|
|||||||
typedef A type;
|
typedef A type;
|
||||||
|
|
||||||
template<class U>
|
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) BOOST_SP_NOEXCEPT
|
||||||
: allocator_(allocator) { }
|
: allocator_(_allocator) { }
|
||||||
|
|
||||||
A& allocator() BOOST_SP_NOEXCEPT {
|
A& allocator() BOOST_SP_NOEXCEPT {
|
||||||
return allocator_;
|
return allocator_;
|
||||||
|
@@ -97,7 +97,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<T> load( int = 0 ) const BOOST_SP_NOEXCEPT
|
shared_ptr<T> load() const BOOST_SP_NOEXCEPT
|
||||||
|
{
|
||||||
|
boost::detail::spinlock::scoped_lock lock( l_ );
|
||||||
|
return p_;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class M> shared_ptr<T> load( M ) const BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
boost::detail::spinlock::scoped_lock lock( l_ );
|
boost::detail::spinlock::scoped_lock lock( l_ );
|
||||||
return p_;
|
return p_;
|
||||||
@@ -109,13 +115,19 @@ public:
|
|||||||
return p_;
|
return p_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void store( shared_ptr<T> r, int = 0 ) BOOST_SP_NOEXCEPT
|
void store( shared_ptr<T> r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
boost::detail::spinlock::scoped_lock lock( l_ );
|
boost::detail::spinlock::scoped_lock lock( l_ );
|
||||||
p_.swap( r );
|
p_.swap( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<T> exchange( shared_ptr<T> r, int = 0 ) BOOST_SP_NOEXCEPT
|
template<class M> void store( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT
|
||||||
|
{
|
||||||
|
boost::detail::spinlock::scoped_lock lock( l_ );
|
||||||
|
p_.swap( r );
|
||||||
|
}
|
||||||
|
|
||||||
|
shared_ptr<T> exchange( shared_ptr<T> r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
boost::detail::spinlock::scoped_lock lock( l_ );
|
boost::detail::spinlock::scoped_lock lock( l_ );
|
||||||
@@ -133,44 +145,82 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, int, int ) BOOST_SP_NOEXCEPT
|
template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) BOOST_SP_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
|
||||||
{
|
{
|
||||||
return compare_exchange( v, w );
|
return compare_exchange( v, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, int = 0 ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, w );
|
return compare_exchange( v, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, int, int ) BOOST_SP_NOEXCEPT
|
bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, w );
|
return compare_exchange( v, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, int = 0 ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_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
|
||||||
|
{
|
||||||
|
return compare_exchange( v, w );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, w );
|
return compare_exchange( v, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||||
|
|
||||||
bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, int, int ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, int = 0 ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, int, int ) BOOST_SP_NOEXCEPT
|
bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, int = 0 ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_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
|
||||||
|
{
|
||||||
|
return compare_exchange( v, std::move( w ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
}
|
}
|
||||||
|
@@ -65,6 +65,15 @@ extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRI
|
|||||||
|
|
||||||
typedef ::CRITICAL_SECTION critical_section;
|
typedef ::CRITICAL_SECTION critical_section;
|
||||||
|
|
||||||
|
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||||
|
using ::InitializeCriticalSectionEx;
|
||||||
|
#else
|
||||||
|
using ::InitializeCriticalSection;
|
||||||
|
#endif
|
||||||
|
using ::EnterCriticalSection;
|
||||||
|
using ::LeaveCriticalSection;
|
||||||
|
using ::DeleteCriticalSection;
|
||||||
|
|
||||||
#endif // #ifndef BOOST_USE_WINDOWS_H
|
#endif // #ifndef BOOST_USE_WINDOWS_H
|
||||||
|
|
||||||
class lightweight_mutex
|
class lightweight_mutex
|
||||||
|
@@ -70,8 +70,8 @@ private:
|
|||||||
sp_counted_base( sp_counted_base const & );
|
sp_counted_base( sp_counted_base const & );
|
||||||
sp_counted_base & operator= ( sp_counted_base const & );
|
sp_counted_base & operator= ( sp_counted_base const & );
|
||||||
|
|
||||||
atomic_int_least32_t use_count_; // #shared
|
atomic_int_least32_t use_count_; // #shared
|
||||||
atomic_int_least32_t weak_count_; // #weak + (#shared != 0)
|
atomic_int_least32_t weak_count_; // #weak + (#shared != 0)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@@ -38,7 +38,9 @@ inline void atomic_increment( int * pw )
|
|||||||
(
|
(
|
||||||
"0:\n\t"
|
"0:\n\t"
|
||||||
".set push\n\t"
|
".set push\n\t"
|
||||||
|
#if !defined(__mips_isa_rev) || (__mips_isa_rev < 6)
|
||||||
".set mips2\n\t"
|
".set mips2\n\t"
|
||||||
|
#endif
|
||||||
"ll %0, %1\n\t"
|
"ll %0, %1\n\t"
|
||||||
"addiu %0, 1\n\t"
|
"addiu %0, 1\n\t"
|
||||||
"sc %0, %1\n\t"
|
"sc %0, %1\n\t"
|
||||||
@@ -59,7 +61,9 @@ inline int atomic_decrement( int * pw )
|
|||||||
(
|
(
|
||||||
"0:\n\t"
|
"0:\n\t"
|
||||||
".set push\n\t"
|
".set push\n\t"
|
||||||
|
#if !defined(__mips_isa_rev) || (__mips_isa_rev < 6)
|
||||||
".set mips2\n\t"
|
".set mips2\n\t"
|
||||||
|
#endif
|
||||||
"ll %1, %2\n\t"
|
"ll %1, %2\n\t"
|
||||||
"addiu %0, %1, -1\n\t"
|
"addiu %0, %1, -1\n\t"
|
||||||
"sc %0, %2\n\t"
|
"sc %0, %2\n\t"
|
||||||
@@ -85,7 +89,9 @@ inline int atomic_conditional_increment( int * pw )
|
|||||||
(
|
(
|
||||||
"0:\n\t"
|
"0:\n\t"
|
||||||
".set push\n\t"
|
".set push\n\t"
|
||||||
|
#if !defined(__mips_isa_rev) || (__mips_isa_rev < 6)
|
||||||
".set mips2\n\t"
|
".set mips2\n\t"
|
||||||
|
#endif
|
||||||
"ll %0, %2\n\t"
|
"ll %0, %2\n\t"
|
||||||
"beqz %0, 1f\n\t"
|
"beqz %0, 1f\n\t"
|
||||||
"addiu %1, %0, 1\n\t"
|
"addiu %1, %0, 1\n\t"
|
||||||
|
@@ -64,8 +64,8 @@ private:
|
|||||||
sp_counted_base( sp_counted_base const & );
|
sp_counted_base( sp_counted_base const & );
|
||||||
sp_counted_base & operator= ( sp_counted_base const & );
|
sp_counted_base & operator= ( sp_counted_base const & );
|
||||||
|
|
||||||
std::atomic_int_least32_t use_count_; // #shared
|
std::atomic_int_least32_t use_count_; // #shared
|
||||||
std::atomic_int_least32_t weak_count_; // #weak + (#shared != 0)
|
std::atomic_int_least32_t weak_count_; // #weak + (#shared != 0)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@@ -239,9 +239,9 @@ public:
|
|||||||
|
|
||||||
template< class Y, class D >
|
template< class Y, class D >
|
||||||
local_shared_ptr( boost::movelib::unique_ptr< Y, D > r ); // !
|
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) ) ) )
|
// : px( r.get() ), pn( new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) ) ) )
|
||||||
//{
|
//{
|
||||||
// boost::detail::sp_assert_convertible< Y, T >();
|
// boost::detail::sp_assert_convertible< Y, T >();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// copy constructor
|
// copy constructor
|
||||||
|
@@ -1080,7 +1080,7 @@ template<class T> shared_ptr<T> atomic_load( shared_ptr<T> const * p ) BOOST_SP_
|
|||||||
return *p;
|
return *p;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> inline shared_ptr<T> atomic_load_explicit( shared_ptr<T> const * p, /*memory_order mo*/ int ) BOOST_SP_NOEXCEPT
|
template<class T, class M> inline shared_ptr<T> atomic_load_explicit( shared_ptr<T> const * p, /*memory_order mo*/ M ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return atomic_load( p );
|
return atomic_load( p );
|
||||||
}
|
}
|
||||||
@@ -1091,7 +1091,7 @@ template<class T> void atomic_store( shared_ptr<T> * p, shared_ptr<T> r ) BOOST_
|
|||||||
p->swap( r );
|
p->swap( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> inline void atomic_store_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ int ) 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 ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
atomic_store( p, r ); // std::move( r )
|
atomic_store( p, r ); // std::move( r )
|
||||||
}
|
}
|
||||||
@@ -1107,7 +1107,7 @@ template<class T> shared_ptr<T> atomic_exchange( shared_ptr<T> * p, shared_ptr<T
|
|||||||
return r; // return std::move( r )
|
return r; // return std::move( r )
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> shared_ptr<T> inline atomic_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> r, /*memory_order mo*/ int ) 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 ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return atomic_exchange( p, r ); // std::move( r )
|
return atomic_exchange( p, r ); // std::move( r )
|
||||||
}
|
}
|
||||||
@@ -1137,7 +1137,7 @@ template<class T> bool atomic_compare_exchange( shared_ptr<T> * p, shared_ptr<T>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> inline bool atomic_compare_exchange_explicit( shared_ptr<T> * p, shared_ptr<T> * v, shared_ptr<T> w, /*memory_order success*/ int, /*memory_order failure*/ int ) 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 ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return atomic_compare_exchange( p, v, w ); // std::move( w )
|
return atomic_compare_exchange( p, v, w ); // std::move( w )
|
||||||
}
|
}
|
||||||
|
25
test/Jamfile
25
test/Jamfile
@@ -1,6 +1,6 @@
|
|||||||
# Boost.SmartPtr Library test Jamfile
|
# Boost.SmartPtr Library test Jamfile
|
||||||
#
|
#
|
||||||
# Copyright (c) 2003-2017 Peter Dimov
|
# Copyright (c) 2003-2018 Peter Dimov
|
||||||
# Copyright (c) 2003 Dave Abrahams
|
# Copyright (c) 2003 Dave Abrahams
|
||||||
#
|
#
|
||||||
# Distributed under the Boost Software License, Version 1.0. (See
|
# Distributed under the Boost Software License, Version 1.0. (See
|
||||||
@@ -10,6 +10,10 @@
|
|||||||
# bring in rules for testing
|
# bring in rules for testing
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
|
# quick test (for CI)
|
||||||
|
run quick.cpp ;
|
||||||
|
|
||||||
|
# full test suite
|
||||||
run smart_ptr_test.cpp ;
|
run smart_ptr_test.cpp ;
|
||||||
run shared_ptr_basic_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-non-virtual-dtor ;
|
run shared_ptr_basic_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-non-virtual-dtor ;
|
||||||
run shared_ptr_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-non-virtual-dtor ;
|
run shared_ptr_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-non-virtual-dtor ;
|
||||||
@@ -22,6 +26,7 @@ run intrusive_ptr_move_test.cpp ;
|
|||||||
run intrusive_ref_counter_test.cpp ;
|
run intrusive_ref_counter_test.cpp ;
|
||||||
run atomic_count_test.cpp ;
|
run atomic_count_test.cpp ;
|
||||||
run lw_mutex_test.cpp ;
|
run lw_mutex_test.cpp ;
|
||||||
|
run lw_mutex_test.cpp : : : <define>BOOST_USE_WINDOWS_H : lw_mutex_test.win_h ;
|
||||||
compile-fail shared_ptr_assign_fail.cpp ;
|
compile-fail shared_ptr_assign_fail.cpp ;
|
||||||
compile-fail shared_ptr_delete_fail.cpp ;
|
compile-fail shared_ptr_delete_fail.cpp ;
|
||||||
compile-fail shared_ptr_compare_fail.cpp ;
|
compile-fail shared_ptr_compare_fail.cpp ;
|
||||||
@@ -46,7 +51,11 @@ run yield_k_test.cpp : : : <threading>multi : yield_k_test.mt ;
|
|||||||
run spinlock_test.cpp ;
|
run spinlock_test.cpp ;
|
||||||
run spinlock_try_test.cpp ;
|
run spinlock_try_test.cpp ;
|
||||||
run spinlock_try_test.cpp : : : <threading>multi : spinlock_try_test.mt ;
|
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 ;
|
||||||
|
|
||||||
run make_shared_test.cpp ;
|
run make_shared_test.cpp ;
|
||||||
run make_shared_move_emulation_test.cpp ;
|
run make_shared_move_emulation_test.cpp ;
|
||||||
run make_shared_perfect_forwarding_test.cpp ;
|
run make_shared_perfect_forwarding_test.cpp ;
|
||||||
@@ -63,7 +72,7 @@ run sp_recursive_assign_test.cpp ;
|
|||||||
run sp_recursive_assign2_test.cpp ;
|
run sp_recursive_assign2_test.cpp ;
|
||||||
run sp_recursive_assign_rv_test.cpp ;
|
run sp_recursive_assign_rv_test.cpp ;
|
||||||
run sp_recursive_assign2_rv_test.cpp ;
|
run sp_recursive_assign2_rv_test.cpp ;
|
||||||
compile-fail auto_ptr_lv_fail.cpp ;
|
compile-fail auto_ptr_lv_fail.cpp : <toolset>gcc-4.4.7:<build>no ;
|
||||||
run atomic_count_test2.cpp ;
|
run atomic_count_test2.cpp ;
|
||||||
run sp_typeinfo_test.cpp ;
|
run sp_typeinfo_test.cpp ;
|
||||||
compile make_shared_fp_test.cpp ;
|
compile make_shared_fp_test.cpp ;
|
||||||
@@ -144,13 +153,13 @@ compile-fail array_fail_member_access.cpp ;
|
|||||||
compile-fail array_fail_array_access.cpp ;
|
compile-fail array_fail_array_access.cpp ;
|
||||||
|
|
||||||
run make_shared_array_test.cpp ;
|
run make_shared_array_test.cpp ;
|
||||||
run make_shared_arrays_test.cpp : : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
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 ;
|
run make_shared_array_throws_test.cpp ;
|
||||||
run make_shared_array_esft_test.cpp ;
|
run make_shared_array_esft_test.cpp ;
|
||||||
run make_shared_array_noinit_test.cpp ;
|
run make_shared_array_noinit_test.cpp ;
|
||||||
run make_shared_array_value_test.cpp ;
|
run make_shared_array_value_test.cpp ;
|
||||||
run allocate_shared_array_test.cpp ;
|
run allocate_shared_array_test.cpp ;
|
||||||
run allocate_shared_arrays_test.cpp : : : <toolset>gcc-4.6.3_0x:<cxxflags>-fno-deduce-init-list ;
|
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 ;
|
run allocate_shared_array_throws_test.cpp ;
|
||||||
run allocate_shared_array_esft_test.cpp ;
|
run allocate_shared_array_esft_test.cpp ;
|
||||||
run allocate_shared_array_noinit_test.cpp ;
|
run allocate_shared_array_noinit_test.cpp ;
|
||||||
@@ -159,7 +168,7 @@ run allocate_shared_array_construct_test.cpp ;
|
|||||||
|
|
||||||
run make_unique_test.cpp ;
|
run make_unique_test.cpp ;
|
||||||
run make_unique_args_test.cpp ;
|
run make_unique_args_test.cpp ;
|
||||||
run make_unique_value_test.cpp ;
|
run make_unique_value_test.cpp : : : <toolset>gcc-4.6:<cxxflags>-fno-deduce-init-list ;
|
||||||
run make_unique_noinit_test.cpp ;
|
run make_unique_noinit_test.cpp ;
|
||||||
run make_unique_throws_test.cpp ;
|
run make_unique_throws_test.cpp ;
|
||||||
run make_unique_array_test.cpp ;
|
run make_unique_array_test.cpp ;
|
||||||
@@ -259,3 +268,7 @@ run allocate_local_shared_array_construct_test.cpp ;
|
|||||||
run local_sp_fn_test.cpp ;
|
run local_sp_fn_test.cpp ;
|
||||||
run lsp_convertible_test.cpp ;
|
run lsp_convertible_test.cpp ;
|
||||||
run lsp_convertible_test2.cpp ;
|
run lsp_convertible_test2.cpp ;
|
||||||
|
|
||||||
|
run make_shared_array_tmp_test.cpp ;
|
||||||
|
|
||||||
|
run lw_thread_test.cpp : : : <threading>multi ;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// atomic_sp_constexpr_test.cpp
|
// atomic_sp_constexpr_test.cpp
|
||||||
//
|
//
|
||||||
// Copyright 2017 Peter Dimov
|
// Copyright 2017, 2018 Peter Dimov
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@@ -9,32 +9,37 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/config/workaround.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
#define HAVE_CONSTEXPR_INIT
|
#include <boost/config/helper_macros.hpp>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_CONSTEXPR )
|
#if defined( BOOST_NO_CXX11_CONSTEXPR )
|
||||||
# undef HAVE_CONSTEXPR_INIT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_CONSTEXPR")
|
||||||
# undef HAVE_CONSTEXPR_INIT
|
int main() {}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR )
|
#elif BOOST_WORKAROUND( BOOST_MSVC, < 1920 )
|
||||||
# undef HAVE_CONSTEXPR_INIT
|
|
||||||
#endif
|
// MSVC does not implement static initialization for constexpr
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_MSVC < 1920")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR )
|
||||||
|
|
||||||
|
// Clang only implements static initialization for constexpr in C++14 mode
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test due to __clang__ and BOOST_NO_CXX14_CONSTEXPR")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 )
|
||||||
|
|
||||||
#if defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 5000 )
|
|
||||||
// in libc++, atomic_flag has a non-constexpr constructor from bool
|
// in libc++, atomic_flag has a non-constexpr constructor from bool
|
||||||
# undef HAVE_CONSTEXPR_INIT
|
BOOST_PRAGMA_MESSAGE("Skipping test due to _LIBCPP_VERSION " BOOST_STRINGIZE(_LIBCPP_VERSION))
|
||||||
#endif
|
int main() {}
|
||||||
|
|
||||||
#if !defined( HAVE_CONSTEXPR_INIT ) || defined( BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX )
|
#elif defined( BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX )
|
||||||
|
|
||||||
int main()
|
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX")
|
||||||
{
|
int main() {}
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -69,4 +74,4 @@ int main()
|
|||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined( BOOST_NO_CXX11_CONSEXPR )
|
#endif
|
||||||
|
36
test/lw_thread_test.cpp
Normal file
36
test/lw_thread_test.cpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
// lw_thread_test.cpp
|
||||||
|
//
|
||||||
|
// Copyright 2018 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
|
||||||
|
#include <boost/detail/lightweight_thread.hpp>
|
||||||
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
|
#include <boost/smart_ptr/detail/atomic_count.hpp>
|
||||||
|
|
||||||
|
boost::detail::atomic_count count( 0 );
|
||||||
|
|
||||||
|
void f()
|
||||||
|
{
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int const N = 4;
|
||||||
|
pthread_t th[ N ] = {};
|
||||||
|
|
||||||
|
for( int i = 0; i < N; ++i )
|
||||||
|
{
|
||||||
|
boost::detail::lw_thread_create( th[ i ], f );
|
||||||
|
}
|
||||||
|
|
||||||
|
for( int i = 0; i < N; ++i )
|
||||||
|
{
|
||||||
|
pthread_join( th[ i ], 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( count, N );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
43
test/make_shared_array_tmp_test.cpp
Normal file
43
test/make_shared_array_tmp_test.cpp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// make_shared_array_tmp_test.cpp
|
||||||
|
//
|
||||||
|
// Copyright 2017 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/make_shared.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
struct X
|
||||||
|
{
|
||||||
|
static int destroyed;
|
||||||
|
|
||||||
|
~X()
|
||||||
|
{
|
||||||
|
++destroyed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int X::destroyed = 0;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
X::destroyed = 0;
|
||||||
|
|
||||||
|
boost::make_shared< X[3] >();
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( X::destroyed, 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
X::destroyed = 0;
|
||||||
|
|
||||||
|
boost::make_shared< X[] >( 3 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( X::destroyed, 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
80
test/quick.cpp
Normal file
80
test/quick.cpp
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
//
|
||||||
|
// quick.cpp - a quick (CI) test for Boost.SmartPtr
|
||||||
|
//
|
||||||
|
// Copyright 2017 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/smart_ptr.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
class X
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
X( X const & );
|
||||||
|
X & operator=( X const & );
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static int instances;
|
||||||
|
|
||||||
|
X()
|
||||||
|
{
|
||||||
|
++instances;
|
||||||
|
}
|
||||||
|
|
||||||
|
~X()
|
||||||
|
{
|
||||||
|
--instances;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int X::instances = 0;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
boost::shared_ptr<X> p1( new X );
|
||||||
|
BOOST_TEST_EQ( X::instances, 1 );
|
||||||
|
BOOST_TEST_EQ( p1.use_count(), 1 );
|
||||||
|
|
||||||
|
boost::shared_ptr<X> p2( p1 );
|
||||||
|
BOOST_TEST_EQ( p2.use_count(), 2 );
|
||||||
|
|
||||||
|
boost::weak_ptr<X> wp( p1 );
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 2 );
|
||||||
|
|
||||||
|
p1.reset();
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 1 );
|
||||||
|
|
||||||
|
p2.reset();
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 0 );
|
||||||
|
BOOST_TEST_EQ( X::instances, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
boost::shared_ptr<X> p1 = boost::make_shared<X>();
|
||||||
|
BOOST_TEST_EQ( X::instances, 1 );
|
||||||
|
BOOST_TEST_EQ( p1.use_count(), 1 );
|
||||||
|
|
||||||
|
boost::shared_ptr<X> p2( p1 );
|
||||||
|
BOOST_TEST_EQ( p2.use_count(), 2 );
|
||||||
|
|
||||||
|
boost::weak_ptr<X> wp( p1 );
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 2 );
|
||||||
|
|
||||||
|
p1.reset();
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 1 );
|
||||||
|
|
||||||
|
p2.reset();
|
||||||
|
BOOST_TEST_EQ( wp.use_count(), 0 );
|
||||||
|
BOOST_TEST_EQ( X::instances, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
@@ -14,6 +14,8 @@
|
|||||||
// 20 Jul 99 header name changed to .hpp
|
// 20 Jul 99 header name changed to .hpp
|
||||||
// 20 Apr 99 additional error tests added.
|
// 20 Apr 99 additional error tests added.
|
||||||
|
|
||||||
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
#if defined(BOOST_MSVC)
|
||||||
|
Reference in New Issue
Block a user