Compare commits

...

8 Commits

Author SHA1 Message Date
Andrey Semashev
75276a055d Disabled all but one OS X jobs because they are slow on Travis CI. 2019-10-22 15:11:41 +03:00
Andrey Semashev
309e6a1b31 Updated CI configs, added compilers. 2019-10-22 00:52:54 +03:00
Andrey Semashev
9eeb7f85c5 Replaced tabs with spaces. 2019-06-25 15:46:36 +03:00
Daniel Frey
62c34f51f6 Avoid confusion with the spaceship operator, fixes #59 2019-04-30 18:29:28 +02:00
Glen Fernandes
6a1917ceec Add Free Functions section heading 2019-04-29 20:12:30 -04:00
Glen Fernandes
47c9f69ffe Correct documentation URLs and update documentation 2019-04-29 18:48:51 -04:00
Glen Fernandes
7b74d2d494 Update libraries.json and documentation 2019-04-23 15:37:57 -04:00
Marshall Clow
57da5f0c18 Merge pull request #58 from boostorg/ostream_write
Refactor stream write functionality into a standalone utility
2019-04-23 03:56:04 -07:00
7 changed files with 236 additions and 54 deletions

View File

@@ -1,4 +1,5 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright 2019 Andrey Semashev
# 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)
@@ -24,12 +25,32 @@ matrix:
- env: BOGUS_JOB=true
include:
# gcc, Linux
- os: linux
compiler: g++
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
dist: trusty
compiler: gcc-4.4
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
addons:
apt:
packages:
- g++-4.4
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.7
dist: trusty
compiler: gcc-4.6
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
addons:
apt:
packages:
- g++-4.6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: gcc-4.7
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
@@ -39,7 +60,8 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.8
dist: xenial
compiler: gcc-4.8
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
@@ -47,8 +69,10 @@ matrix:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.9
dist: xenial
compiler: gcc-4.9
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
@@ -58,7 +82,8 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-5
dist: xenial
compiler: gcc-5
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
addons:
apt:
@@ -68,7 +93,8 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-6
dist: xenial
compiler: gcc-6
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
addons:
apt:
@@ -78,8 +104,8 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
dist: xenial
compiler: gcc-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
addons:
apt:
@@ -89,9 +115,9 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17
dist: xenial
compiler: gcc-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
@@ -100,22 +126,34 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
dist: bionic
compiler: gcc-9
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- g++-9
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
# clang, Linux
- os: linux
compiler: clang++-3.5
dist: trusty
compiler: clang-3.5
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
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.5 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-3.6
dist: trusty
compiler: clang-3.6
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
addons:
apt:
@@ -124,10 +162,12 @@ matrix:
- libstdc++-5-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.6 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-3.7
dist: trusty
compiler: clang-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
addons:
apt:
@@ -136,83 +176,149 @@ matrix:
- libstdc++-5-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-3.8
dist: xenial
compiler: clang-3.8
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.8
- libstdc++-5-dev
- libstdc++-6-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-3.9
dist: xenial
compiler: clang-3.9
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
- libstdc++-5-dev
- libstdc++-6-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-4.0
dist: xenial
compiler: clang-4
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-4.0
- libstdc++-5-dev
- libstdc++-6-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-5.0
dist: xenial
compiler: clang-5
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-5.0
- libstdc++-5-dev
- libstdc++-7-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17
dist: xenial
compiler: clang-6
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-6.0
- libstdc++-5-dev
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17
dist: xenial
compiler: clang-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-7
- libstdc++-5-dev
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-8
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-9
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- clang-9
- libstdc++-9-dev
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-libc++
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a CXXFLAGS="-stdlib=libc++" LINKFLAGS="-stdlib=libc++"
addons:
apt:
packages:
- clang-9
- libc++-9-dev
- libc++abi-9-dev
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
# clang, OS X
# OS X builds are slow on Travis CI
# - os: osx
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
# osx_image: xcode9.4
#
# - os: osx
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
# osx_image: xcode10.3
- os: osx
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,17
osx_image: xcode11.2
install:
- GIT_FETCH_JOBS=8
@@ -243,7 +349,7 @@ script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- BUILD_JOBS=`(nproc || sysctl -n hw.ncpu) 2> /dev/null`
- ./b2 -j $BUILD_JOBS libs/utility/test toolset=$TOOLSET cxxstd=$CXXSTD
- ./b2 -j $BUILD_JOBS libs/utility/test toolset=$TOOLSET cxxstd=$CXXSTD ${CXXFLAGS:+cxxflags="$CXXFLAGS"} ${LINKFLAGS:+linkflags="$LINKFLAGS"}
notifications:
email:

View File

@@ -1,4 +1,5 @@
# Copyright 2016-2019 Peter Dimov
# Copyright 2019 Andrey Semashev
# 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)
@@ -14,15 +15,43 @@ branches:
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0,msvc-14.0
- TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.0
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.1
CXXSTD: 14,17
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.2
ADDRMD: 32,64
CXXSTD: 14,17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: clang-win
ADDRMD: 32,64
CXXSTD: 14,17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
ADDPATH: C:\cygwin\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
ADDPATH: C:\cygwin64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
ADDPATH: C:\mingw\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
install:
- set GIT_FETCH_JOBS=8

View File

@@ -15,7 +15,7 @@ Distributed under the Boost Software License, Version 1.0.
[section Overview]
The header <boost/utility/ostream_string.hpp> provides the function template
boost::ostream_string for formatted output that satisfies the requirements of
`boost::ostream_string` for formatted output that satisfies the requirements of
\[ostream.formatted.reqmts\].
[endsect]
@@ -50,13 +50,29 @@ ostream_string(std::basic_ostream<charT, traits>& os,
} /* boost */
```
[heading Free functions]
[variablelist
[[`template<class charT, class traits> std::basic_ostream<charT, traits>&
ostream_string(std::basic_ostream<charT, traits>& os, const charT* data,
std::size_t size);`]
[[variablelist
[[Effects]
[Behaves like a formatted inserter (as described in
\[ostream.formatted.reqmts\]) of `os`. Creates a character sequence `seq` of
`size` characters starting at `data`, each widened using `os.widen()`
(\[basic.ios.members\]). Determines padding for `seq` as described in
\[ostream.formatted.reqmts\]. Inserts `seq` into `os`. Calls `width(0)`.]]
[[Returns] [`os`.]]]
[[Returns][`os`.]]]]]]
[endsect]
[section History]
[heading boost 1.71]
* Glen Fernandes updated the implementation of the `basic_string_ref` and
`basic_string_view` stream insertion operators to write directly to the
`basic_streambuf` and refactored that functionality into this common utility.
[endsect]

View File

@@ -156,6 +156,11 @@ String-like operations:
[section History]
[/===============]
[heading boost 1.71]
* Glen Fernandes updated the implementation of the stream insertion operator to
write directly to the `basic_streambuf` and refactored that functionality into
a common utility.
[heading boost 1.53]
* Introduced

View File

@@ -186,7 +186,7 @@ namespace boost {
if (pos > size())
BOOST_THROW_EXCEPTION(std::out_of_range("string_view::copy" ));
size_type rlen = (std::min)(n, len_ - pos);
traits_type::copy(s, data() + pos, rlen);
traits_type::copy(s, data() + pos, rlen);
return rlen;
}

View File

@@ -85,6 +85,19 @@
"Daniel Frey <d.frey -at- gmx.de>"
]
},
{
"key": "utility/ostream_string",
"name": "ostream_string",
"description": "String formatted output function.",
"documentation": "doc/html/ostream_string.html",
"category": [
"IO"
],
"authors": "Glen Fernandes",
"maintainers": [
"Glen Fernandes <glenjofe -at- gmail.com>"
]
},
{
"key": "utility/result_of",
"name": "Result Of",
@@ -98,6 +111,19 @@
"Daniel Walker <daniel.j.walker -at- gmail.com>"
]
},
{
"key": "utility/string_ref",
"name": "string_ref",
"description": "String view templates.",
"documentation": "doc/html/string_ref.html",
"category": [
"Containers"
],
"authors": "Marshall Clow",
"maintainers": [
"Marshall Clow <marshall -at- idio.com>"
]
},
{
"key": "utility/value_initialized",
"name": "Value Initialized",

View File

@@ -119,8 +119,8 @@
also want <code>x &gt; y, x &gt;= y,</code> and <code>x &lt;= y</code>.
Moreover, unless your class has really surprising behavior, some of these
related operators can be defined in terms of others (e.g. <code>x &gt;= y
&lt;=&gt; !(x &lt; y)</code>). Replicating this boilerplate for multiple
classes is both tedious and error-prone. The <cite><a href=
is equivalent to !(x &lt; y)</code>). Replicating this boilerplate for
multiple classes is both tedious and error-prone. The <cite><a href=
"../../boost/operators.hpp">boost/operators.hpp</a></cite> templates help
by generating operators for you at namespace scope based on other
operators you've defined in your class.</p>