Compare commits
279 Commits
svn-branch
...
boost-1.63
Author | SHA1 | Date | |
---|---|---|---|
6c11197586 | |||
e88ec2fc6e | |||
94f1e6b0c6 | |||
6abcc6cd09 | |||
03b1576241 | |||
7368c13108 | |||
3b915c053d | |||
3224a71ccc | |||
1aa7f4d8fc | |||
10f1da5034 | |||
4013403c44 | |||
e9c548eeb5 | |||
11a9234e13 | |||
313c13b263 | |||
99f7f4042f | |||
bda87dd74e | |||
fbf832c900 | |||
32b98c7586 | |||
9fcf2ae390 | |||
b0a2809915 | |||
2fe0e70a94 | |||
fbc7c23ab1 | |||
678a7ed98b | |||
3dde52aaa3 | |||
398479e296 | |||
f24860d28c | |||
fcaf168000 | |||
1fef8494fe | |||
26cf086520 | |||
5ef03bffe3 | |||
275643c97b | |||
509c2421e3 | |||
1318e4a728 | |||
e87cff715b | |||
80d39bd695 | |||
3e560e9927 | |||
fb36ac293c | |||
1dc95cb4cb | |||
a1a7d328bb | |||
efc21f5bf4 | |||
d9d6e09ca9 | |||
05fecc6e3e | |||
ec72ca9b03 | |||
5cdcab8b51 | |||
231ba60b50 | |||
9663320036 | |||
c9cceb0ce9 | |||
a9cc3926de | |||
678063ef3a | |||
83be62c6c1 | |||
676d007618 | |||
38fc0a4352 | |||
b4e608fcf2 | |||
2644ef67ac | |||
099854dece | |||
9063b1d1fd | |||
9288a7df75 | |||
c75e59f0e1 | |||
78b061c1e1 | |||
a46db5a32e | |||
d436bcd121 | |||
7312799cc0 | |||
3194681a02 | |||
16ee7725f4 | |||
3d6fdcfda4 | |||
345b3a3b50 | |||
094070e5e4 | |||
33bc52789a | |||
3dd2674052 | |||
d5699c31c9 | |||
c1b71a6f12 | |||
55f85a4d1f | |||
8c689a1533 | |||
f362e5e72f | |||
4a5de13017 | |||
3220177536 | |||
1e84644646 | |||
84da532b39 | |||
54822d775b | |||
bae1bebd28 | |||
59ce745040 | |||
8e3280c8ee | |||
3319b4ac54 | |||
3dafb197cc | |||
0e75aca4dd | |||
d32882cc08 | |||
6395ed2f25 | |||
a747594bdd | |||
684ee20edb | |||
5e28401195 | |||
2114a3d026 | |||
0f9b39df3f | |||
933b2c596b | |||
4dc7897c9f | |||
41f09db5d6 | |||
c8ca7d9788 | |||
1de858a76f | |||
275fe9d73b | |||
8ca67eedb4 | |||
1ec40ed29c | |||
589631a886 | |||
41e2470d21 | |||
eb60febe83 | |||
73c18922d1 | |||
ce5864b47e | |||
8590e40965 | |||
e1e8b05e02 | |||
79bce0a5f2 | |||
2b05049c56 | |||
6a98633c6c | |||
06aac2f311 | |||
81cbc142ac | |||
8bfa4e2836 | |||
bd58c2d229 | |||
610e913595 | |||
19ca421f24 | |||
538f8f7b3b | |||
ae93c52b75 | |||
d50a20412b | |||
eb6208f69a | |||
d5aa8a952a | |||
dc1a439ec0 | |||
c77e8e89cf | |||
2ea55870e4 | |||
436afec8b3 | |||
112b2471b7 | |||
2cbdcde368 | |||
689df8ea62 | |||
67f78550e5 | |||
5973a2bcef | |||
d8159674fa | |||
0c7444b84f | |||
804546aacf | |||
02d2fb38e3 | |||
c11c0ef97b | |||
b39e23464b | |||
0e2bc0d9f4 | |||
9378f3d4f7 | |||
20332e24e5 | |||
6caa4f2698 | |||
2a116b4ea4 | |||
a017040e81 | |||
e0e8ccb712 | |||
de25ca2c03 | |||
17612676b8 | |||
06c06ee09c | |||
948271c0ae | |||
9436535318 | |||
469b547c88 | |||
609cf3c49f | |||
735804d636 | |||
4c711ba972 | |||
0f51c7701d | |||
32b452486f | |||
7b712685ce | |||
b95901a068 | |||
2423aff085 | |||
8a12de16a4 | |||
e87588af6a | |||
bb1f3d690a | |||
3b2a3d1cfc | |||
be8f3b19eb | |||
799953dd55 | |||
e2ed5892c2 | |||
860576c740 | |||
07227dd61d | |||
1d3205b456 | |||
9f938bf39b | |||
c42fd431af | |||
704bb6644b | |||
94dcc475a1 | |||
5367f6459d | |||
8717cff3c5 | |||
361414ba84 | |||
4920859a06 | |||
76e55056de | |||
b98d99bc63 | |||
d20069a4d6 | |||
e3049b1480 | |||
74a47fbf05 | |||
0693db0847 | |||
e8060b3ef5 | |||
4a1c553f90 | |||
99f3841839 | |||
91db205d17 | |||
bb233de354 | |||
455d56887e | |||
17d5ed080b | |||
7ce0af2bba | |||
e7f3ca8c2f | |||
475c3310be | |||
d6a77e4054 | |||
a057517431 | |||
2a7bc8999f | |||
6d861790f7 | |||
313008fc31 | |||
1d911d3784 | |||
2c1f83de56 | |||
9261171c6f | |||
d1a4c127eb | |||
0aa7afd1d8 | |||
4f2d881cb1 | |||
cd4810a2e7 | |||
e4ac9a7c8e | |||
af85a27b12 | |||
a4eef8ff7d | |||
d8dc59f6cb | |||
c5dc10b3c4 | |||
c5eac8e96c | |||
00e723fba0 | |||
134c915cbf | |||
3c935aaf8f | |||
c2192c4caf | |||
097a256c16 | |||
726c4a7182 | |||
badf2c8a79 | |||
91672171a6 | |||
1ede593bc2 | |||
812c32a5a1 | |||
7dbb57bc82 | |||
debb7ae2de | |||
4a28e5d5a1 | |||
fc561bdc77 | |||
2438dc56f1 | |||
7247d512f8 | |||
6a458a381b | |||
c888037399 | |||
8c3a497ec8 | |||
cad13ace57 | |||
fbc029e131 | |||
ca7ccbfa77 | |||
3911d7a669 | |||
23850d984a | |||
da8fe765fd | |||
65a58553fb | |||
d425f1e5bf | |||
3178938f98 | |||
0d006f2718 | |||
de4c1b2e9d | |||
770e33343a | |||
a63bc49cfb | |||
472ca5d636 | |||
1df6d3e0e2 | |||
1588a4a05f | |||
aaf3c4ac98 | |||
816cad7bd8 | |||
9d2dd3f219 | |||
c0fb2515b0 | |||
d2ce3c5791 | |||
f8ffc48c7e | |||
120abc637c | |||
34684d4df2 | |||
20ab8a4e7d | |||
c6024a4ac4 | |||
da0f568852 | |||
20c35502cb | |||
4ae97fa5cb | |||
18dbae4700 | |||
b328080dbb | |||
a6af6ca66f | |||
df8aaff6da | |||
06946f6607 | |||
680e819cf3 | |||
22520394e4 | |||
9469ab6c88 | |||
8da5b03c03 | |||
49858c1ac4 | |||
ec6dfefa6e | |||
1df1d181c0 | |||
dc34adabef | |||
8aebcc4fbd | |||
2551c9baf0 | |||
71ec49242e | |||
0dc54e7b18 | |||
4039b44fce | |||
2f7218cdc4 | |||
37cd3c6dd2 | |||
71a268689d | |||
4dda81e93a |
36
doc/build.jam
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Copyright Rene Rivera 2016
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
using quickbook ;
|
||||||
|
using boostbook ;
|
||||||
|
|
||||||
|
xml detail : detail.qbk ;
|
||||||
|
|
||||||
|
install images : [ glob $(BOOST_ROOT)/doc/src/images/*.png ] : <location>html/images ;
|
||||||
|
explicit images ;
|
||||||
|
install callouts : [ glob $(BOOST_ROOT)/doc/src/images/callouts/*.png ] : <location>html/images/callouts ;
|
||||||
|
explicit callouts ;
|
||||||
|
install css : [ glob $(BOOST_ROOT)/doc/src/*.css ] : <location>html ;
|
||||||
|
explicit css ;
|
||||||
|
|
||||||
|
boostbook standalone
|
||||||
|
:
|
||||||
|
detail
|
||||||
|
:
|
||||||
|
<xsl:param>boost.root=../../../..
|
||||||
|
<xsl:param>generate.section.toc.level=3
|
||||||
|
<xsl:param>chunk.section.depth=2
|
||||||
|
#<xsl:param>chunk.first.sections=1
|
||||||
|
|
||||||
|
<dependency>images
|
||||||
|
<dependency>callouts
|
||||||
|
<dependency>css
|
||||||
|
;
|
||||||
|
|
||||||
|
alias boostdoc ;
|
||||||
|
explicit boostdoc ;
|
||||||
|
|
||||||
|
alias boostrelease : standalone ;
|
||||||
|
explicit boostrelease ;
|
19
doc/detail.qbk
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[article Detail
|
||||||
|
[quickbook 1.7]
|
||||||
|
[version 1.0]
|
||||||
|
[copyright 2016 Rene Rivera]
|
||||||
|
[purpose Internal support utilities for Boost C++ Libraries.]
|
||||||
|
[license
|
||||||
|
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])
|
||||||
|
]
|
||||||
|
[source-mode c++]
|
||||||
|
]
|
||||||
|
|
||||||
|
[section Introduction]
|
||||||
|
|
||||||
|
This library contains a set of header only utilities used internally by
|
||||||
|
Boost C++ Libraries to facilitate their implementation.
|
||||||
|
|
||||||
|
[endsect]
|
716
doc/html/boostbook.css
Normal file
@ -0,0 +1,716 @@
|
|||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2004 Joel de Guzman
|
||||||
|
http://spirit.sourceforge.net/
|
||||||
|
|
||||||
|
Copyright 2013 Niall Douglas additions for colors and alignment.
|
||||||
|
Copyright 2013 Paul A. Bristow additions for more colors and alignments.
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||||
|
ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Body defaults
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
body
|
||||||
|
{
|
||||||
|
margin: 1em;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Paragraphs
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
text-align: left;
|
||||||
|
font-size: 10pt;
|
||||||
|
line-height: 1.15;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Program listings
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
/* Code on paragraphs */
|
||||||
|
p tt.computeroutput
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.synopsis
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
margin: 1pc 4% 0pc 4%;
|
||||||
|
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.programlisting,
|
||||||
|
.screen
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
display: block;
|
||||||
|
margin: 1pc 4% 0pc 4%;
|
||||||
|
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Program listings in tables don't get borders */
|
||||||
|
td .programlisting,
|
||||||
|
td .screen
|
||||||
|
{
|
||||||
|
margin: 0pc 0pc 0pc 0pc;
|
||||||
|
padding: 0pc 0pc 0pc 0pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Headings
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6
|
||||||
|
{
|
||||||
|
text-align: left;
|
||||||
|
margin: 1em 0em 0.5em 0em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 { font-size: 140%; }
|
||||||
|
h2 { font-weight: bold; font-size: 140%; }
|
||||||
|
h3 { font-weight: bold; font-size: 130%; }
|
||||||
|
h4 { font-weight: bold; font-size: 120%; }
|
||||||
|
h5 { font-weight: normal; font-style: italic; font-size: 110%; }
|
||||||
|
h6 { font-weight: normal; font-style: italic; font-size: 100%; }
|
||||||
|
|
||||||
|
/* Top page titles */
|
||||||
|
title,
|
||||||
|
h1.title,
|
||||||
|
h2.title
|
||||||
|
h3.title,
|
||||||
|
h4.title,
|
||||||
|
h5.title,
|
||||||
|
h6.title,
|
||||||
|
.refentrytitle
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 1pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1.title { font-size: 140% }
|
||||||
|
h2.title { font-size: 140% }
|
||||||
|
h3.title { font-size: 130% }
|
||||||
|
h4.title { font-size: 120% }
|
||||||
|
h5.title { font-size: 110% }
|
||||||
|
h6.title { font-size: 100% }
|
||||||
|
|
||||||
|
.section h1
|
||||||
|
{
|
||||||
|
margin: 0em 0em 0.5em 0em;
|
||||||
|
font-size: 140%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section h2 { font-size: 140% }
|
||||||
|
.section h3 { font-size: 130% }
|
||||||
|
.section h4 { font-size: 120% }
|
||||||
|
.section h5 { font-size: 110% }
|
||||||
|
.section h6 { font-size: 100% }
|
||||||
|
|
||||||
|
/* Code on titles */
|
||||||
|
h1 tt.computeroutput { font-size: 140% }
|
||||||
|
h2 tt.computeroutput { font-size: 140% }
|
||||||
|
h3 tt.computeroutput { font-size: 130% }
|
||||||
|
h4 tt.computeroutput { font-size: 130% }
|
||||||
|
h5 tt.computeroutput { font-size: 130% }
|
||||||
|
h6 tt.computeroutput { font-size: 130% }
|
||||||
|
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Author
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
h3.author
|
||||||
|
{
|
||||||
|
font-size: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Lists
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
li
|
||||||
|
{
|
||||||
|
font-size: 10pt;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Unordered lists */
|
||||||
|
ul
|
||||||
|
{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ordered lists */
|
||||||
|
ol
|
||||||
|
{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Links
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
a
|
||||||
|
{
|
||||||
|
text-decoration: none; /* no underline */
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Spirit style navigation
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
.spirit-nav
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spirit-nav a
|
||||||
|
{
|
||||||
|
color: white;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spirit-nav img
|
||||||
|
{
|
||||||
|
border-width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright footer
|
||||||
|
=============================================================================*/
|
||||||
|
.copyright-footer
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copyright-footer p
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Table of contents
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
div.toc
|
||||||
|
{
|
||||||
|
margin: 1pc 4% 0pc 4%;
|
||||||
|
padding: 0.1pc 1pc 0.1pc 1pc;
|
||||||
|
font-size: 80%;
|
||||||
|
line-height: 1.15;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boost-toc
|
||||||
|
{
|
||||||
|
float: right;
|
||||||
|
padding: 0.5pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code on toc */
|
||||||
|
.toc .computeroutput { font-size: 120% }
|
||||||
|
|
||||||
|
/* No margin on nested menus */
|
||||||
|
|
||||||
|
.toc dl dl { margin: 0; }
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Tables
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
.table-title,
|
||||||
|
div.table p.title
|
||||||
|
{
|
||||||
|
margin-left: 4%;
|
||||||
|
padding-right: 0.5em;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.informaltable table,
|
||||||
|
.table table
|
||||||
|
{
|
||||||
|
width: 92%;
|
||||||
|
margin-left: 4%;
|
||||||
|
margin-right: 4%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.informaltable table,
|
||||||
|
div.table table
|
||||||
|
{
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table Cells */
|
||||||
|
div.informaltable table tr td,
|
||||||
|
div.table table tr td
|
||||||
|
{
|
||||||
|
padding: 0.5em;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.informaltable table tr th,
|
||||||
|
div.table table tr th
|
||||||
|
{
|
||||||
|
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||||
|
border: 1pt solid white;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.simplelist
|
||||||
|
{
|
||||||
|
width: auto !important;
|
||||||
|
margin: 0em !important;
|
||||||
|
padding: 0em !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
table.simplelist td
|
||||||
|
{
|
||||||
|
margin: 0em !important;
|
||||||
|
padding: 0em !important;
|
||||||
|
text-align: left !important;
|
||||||
|
font-size: 9pt !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Suppress margins in tables
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
table th > *:first-child,
|
||||||
|
table td > *:first-child
|
||||||
|
{
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table th > *:last-child,
|
||||||
|
table td > *:last-child
|
||||||
|
{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Blurbs
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
div.note,
|
||||||
|
div.tip,
|
||||||
|
div.important,
|
||||||
|
div.caution,
|
||||||
|
div.warning,
|
||||||
|
p.blurb
|
||||||
|
{
|
||||||
|
font-size: 9pt; /* A little bit smaller than the main text */
|
||||||
|
line-height: 1.2;
|
||||||
|
display: block;
|
||||||
|
margin: 1pc 4% 0pc 4%;
|
||||||
|
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.blurb img
|
||||||
|
{
|
||||||
|
padding: 1pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Variable Lists
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
div.variablelist
|
||||||
|
{
|
||||||
|
margin: 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make the terms in definition lists bold */
|
||||||
|
div.variablelist dl dt,
|
||||||
|
span.term
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.variablelist table tbody tr td
|
||||||
|
{
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: top;
|
||||||
|
padding: 0em 2em 0em 0em;
|
||||||
|
font-size: 10pt;
|
||||||
|
margin: 0em 0em 0.5em 0em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.variablelist dl dt
|
||||||
|
{
|
||||||
|
margin-bottom: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.variablelist dl dd
|
||||||
|
{
|
||||||
|
margin: 0em 0em 0.5em 2em;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.variablelist table tbody tr td p,
|
||||||
|
div.variablelist dl dd p
|
||||||
|
{
|
||||||
|
margin: 0em 0em 0.5em 0em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Misc
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
/* Title of books and articles in bibliographies */
|
||||||
|
span.title
|
||||||
|
{
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.underline
|
||||||
|
{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.strikethrough
|
||||||
|
{
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Copyright, Legal Notice */
|
||||||
|
div div.legalnotice p
|
||||||
|
{
|
||||||
|
text-align: left
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Colors
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
@media screen
|
||||||
|
{
|
||||||
|
body {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Syntax Highlighting */
|
||||||
|
.keyword { color: #0000AA; }
|
||||||
|
.identifier { color: #000000; }
|
||||||
|
.special { color: #707070; }
|
||||||
|
.preprocessor { color: #402080; }
|
||||||
|
.char { color: teal; }
|
||||||
|
.comment { color: #800000; }
|
||||||
|
.string { color: teal; }
|
||||||
|
.number { color: teal; }
|
||||||
|
.white_bkd { background-color: #FFFFFF; }
|
||||||
|
.dk_grey_bkd { background-color: #999999; }
|
||||||
|
|
||||||
|
/* Links */
|
||||||
|
a, a .keyword, a .identifier, a .special, a .preprocessor
|
||||||
|
a .char, a .comment, a .string, a .number
|
||||||
|
{
|
||||||
|
color: #005a9c;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited, a:visited .keyword, a:visited .identifier,
|
||||||
|
a:visited .special, a:visited .preprocessor a:visited .char,
|
||||||
|
a:visited .comment, a:visited .string, a:visited .number
|
||||||
|
{
|
||||||
|
color: #9c5a9c;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
|
||||||
|
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
|
||||||
|
h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
|
||||||
|
{
|
||||||
|
text-decoration: none; /* no underline */
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Copyright, Legal Notice */
|
||||||
|
.copyright
|
||||||
|
{
|
||||||
|
color: #666666;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
div div.legalnotice p
|
||||||
|
{
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Program listing */
|
||||||
|
pre.synopsis
|
||||||
|
{
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.programlisting,
|
||||||
|
.screen
|
||||||
|
{
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
td .programlisting,
|
||||||
|
td .screen
|
||||||
|
{
|
||||||
|
border: 0px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Blurbs */
|
||||||
|
div.note,
|
||||||
|
div.tip,
|
||||||
|
div.important,
|
||||||
|
div.caution,
|
||||||
|
div.warning,
|
||||||
|
p.blurb
|
||||||
|
{
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table of contents */
|
||||||
|
div.toc
|
||||||
|
{
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tables */
|
||||||
|
div.informaltable table tr td,
|
||||||
|
div.table table tr td
|
||||||
|
{
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.informaltable table tr th,
|
||||||
|
div.table table tr th
|
||||||
|
{
|
||||||
|
background-color: #F0F0F0;
|
||||||
|
border: 1px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copyright-footer
|
||||||
|
{
|
||||||
|
color: #8F8F8F;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Misc */
|
||||||
|
span.highlight
|
||||||
|
{
|
||||||
|
color: #00A000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print
|
||||||
|
{
|
||||||
|
/* Links */
|
||||||
|
a
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spirit-nav
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Program listing */
|
||||||
|
pre.synopsis
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.programlisting,
|
||||||
|
.screen
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
td .programlisting,
|
||||||
|
td .screen
|
||||||
|
{
|
||||||
|
border: 0px solid #DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Table of contents */
|
||||||
|
div.toc
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.informaltable table,
|
||||||
|
.table table
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tables */
|
||||||
|
div.informaltable table tr td,
|
||||||
|
div.table table tr td
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.informaltable table tr th,
|
||||||
|
div.table table tr th
|
||||||
|
{
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.simplelist tr td
|
||||||
|
{
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Misc */
|
||||||
|
span.highlight
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=============================================================================
|
||||||
|
Images
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
span.inlinemediaobject img
|
||||||
|
{
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*==============================================================================
|
||||||
|
Super and Subscript: style so that line spacing isn't effected, see
|
||||||
|
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
|
||||||
|
==============================================================================*/
|
||||||
|
|
||||||
|
sup,
|
||||||
|
sub {
|
||||||
|
height: 0;
|
||||||
|
line-height: 1;
|
||||||
|
vertical-align: baseline;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For internet explorer: */
|
||||||
|
|
||||||
|
* html sup,
|
||||||
|
* html sub {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
bottom: 1ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
top: .5ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*==============================================================================
|
||||||
|
Indexes: pretty much the same as the TOC.
|
||||||
|
==============================================================================*/
|
||||||
|
|
||||||
|
.index
|
||||||
|
{
|
||||||
|
font-size: 80%;
|
||||||
|
padding-top: 0px;
|
||||||
|
padding-bottom: 0px;
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index ul
|
||||||
|
{
|
||||||
|
padding-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index p
|
||||||
|
{
|
||||||
|
padding: 2px;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index-entry-level-0
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index em
|
||||||
|
{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*==============================================================================
|
||||||
|
Alignment and coloring use 'role' feature, available from Quickbook 1.6 up.
|
||||||
|
Added from Niall Douglas for role color and alignment.
|
||||||
|
http://article.gmane.org/gmane.comp.lib.boost.devel/243318
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */
|
||||||
|
span.aligncenter
|
||||||
|
{
|
||||||
|
display: inline-block; width: 100%; text-align: center;
|
||||||
|
}
|
||||||
|
span.alignright
|
||||||
|
{
|
||||||
|
display: inline-block; width: 100%; text-align: right;
|
||||||
|
}
|
||||||
|
/* alignleft is the default. */
|
||||||
|
span.alignleft
|
||||||
|
{
|
||||||
|
display: inline-block; width: 100%; text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* alignjustify stretches the word spacing so that each line has equal width
|
||||||
|
within a chosen fraction of page width (here arbitrarily 20%).
|
||||||
|
*Not* useful inside table items as the column width remains the total string width.
|
||||||
|
Nor very useful, except to temporarily restrict the width.
|
||||||
|
*/
|
||||||
|
span.alignjustify
|
||||||
|
{
|
||||||
|
display: inline-block; width: 20%; text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text colors.
|
||||||
|
Names at http://www.w3.org/TR/2002/WD-css3-color-20020219/ 4.3. X11 color keywords.
|
||||||
|
Quickbook Usage: [role red Some red text]
|
||||||
|
|
||||||
|
*/
|
||||||
|
span.red { inline-block; color: red; }
|
||||||
|
span.green { color: green; }
|
||||||
|
span.lime { color: #00FF00; }
|
||||||
|
span.blue { color: blue; }
|
||||||
|
span.navy { color: navy; }
|
||||||
|
span.yellow { color: yellow; }
|
||||||
|
span.magenta { color: magenta; }
|
||||||
|
span.indigo { color: #4B0082; }
|
||||||
|
span.cyan { color: cyan; }
|
||||||
|
span.purple { color: purple; }
|
||||||
|
span.gold { color: gold; }
|
||||||
|
span.silver { color: silver; } /* lighter gray */
|
||||||
|
span.gray { color: #808080; } /* light gray */
|
275
doc/html/docutils.css
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
/*
|
||||||
|
:Author: David Goodger
|
||||||
|
:Contact: goodger@python.org
|
||||||
|
:Date: $Date$
|
||||||
|
:Revision: $Revision$
|
||||||
|
:Copyright: This stylesheet has been placed in the public domain.
|
||||||
|
|
||||||
|
Default cascading style sheet for the HTML output of Docutils.
|
||||||
|
|
||||||
|
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||||
|
customize this style sheet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* used to remove borders from tables and images */
|
||||||
|
.borderless, table.borderless td, table.borderless th {
|
||||||
|
border: 0 }
|
||||||
|
|
||||||
|
table.borderless td, table.borderless th {
|
||||||
|
/* Override padding for "table.docutils td" with "! important".
|
||||||
|
The right padding separates the table cells. */
|
||||||
|
padding: 0 0.5em 0 0 ! important }
|
||||||
|
|
||||||
|
.first {
|
||||||
|
/* Override more specific margin styles with "! important". */
|
||||||
|
margin-top: 0 ! important }
|
||||||
|
|
||||||
|
.last, .with-subtitle {
|
||||||
|
margin-bottom: 0 ! important }
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none }
|
||||||
|
|
||||||
|
a.toc-backref {
|
||||||
|
text-decoration: none ;
|
||||||
|
color: black }
|
||||||
|
|
||||||
|
blockquote.epigraph {
|
||||||
|
margin: 2em 5em ; }
|
||||||
|
|
||||||
|
dl.docutils dd {
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||||
|
dl.docutils dt {
|
||||||
|
font-weight: bold }
|
||||||
|
*/
|
||||||
|
|
||||||
|
div.abstract {
|
||||||
|
margin: 2em 5em }
|
||||||
|
|
||||||
|
div.abstract p.topic-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||||
|
div.hint, div.important, div.note, div.tip, div.warning {
|
||||||
|
margin: 2em ;
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em }
|
||||||
|
|
||||||
|
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||||
|
div.important p.admonition-title, div.note p.admonition-title,
|
||||||
|
div.tip p.admonition-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||||
|
div.danger p.admonition-title, div.error p.admonition-title,
|
||||||
|
div.warning p.admonition-title {
|
||||||
|
color: red ;
|
||||||
|
font-weight: bold ;
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||||
|
compound paragraphs.
|
||||||
|
div.compound .compound-first, div.compound .compound-middle {
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
div.compound .compound-last, div.compound .compound-middle {
|
||||||
|
margin-top: 0.5em }
|
||||||
|
*/
|
||||||
|
|
||||||
|
div.dedication {
|
||||||
|
margin: 2em 5em ;
|
||||||
|
text-align: center ;
|
||||||
|
font-style: italic }
|
||||||
|
|
||||||
|
div.dedication p.topic-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-style: normal }
|
||||||
|
|
||||||
|
div.figure {
|
||||||
|
margin-left: 2em ;
|
||||||
|
margin-right: 2em }
|
||||||
|
|
||||||
|
div.footer, div.header {
|
||||||
|
clear: both;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
div.line-block {
|
||||||
|
display: block ;
|
||||||
|
margin-top: 1em ;
|
||||||
|
margin-bottom: 1em }
|
||||||
|
|
||||||
|
div.line-block div.line-block {
|
||||||
|
margin-top: 0 ;
|
||||||
|
margin-bottom: 0 ;
|
||||||
|
margin-left: 1.5em }
|
||||||
|
|
||||||
|
div.sidebar {
|
||||||
|
margin-left: 1em ;
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em ;
|
||||||
|
background-color: #ffffee ;
|
||||||
|
width: 40% ;
|
||||||
|
float: right ;
|
||||||
|
clear: right }
|
||||||
|
|
||||||
|
div.sidebar p.rubric {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-size: medium }
|
||||||
|
|
||||||
|
div.system-messages {
|
||||||
|
margin: 5em }
|
||||||
|
|
||||||
|
div.system-messages h1 {
|
||||||
|
color: red }
|
||||||
|
|
||||||
|
div.system-message {
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em }
|
||||||
|
|
||||||
|
div.system-message p.system-message-title {
|
||||||
|
color: red ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
div.topic {
|
||||||
|
margin: 2em }
|
||||||
|
|
||||||
|
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||||
|
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||||
|
margin-top: 0.4em }
|
||||||
|
|
||||||
|
h1.title {
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
h2.subtitle {
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
hr.docutils {
|
||||||
|
width: 75% }
|
||||||
|
|
||||||
|
img.align-left {
|
||||||
|
clear: left }
|
||||||
|
|
||||||
|
img.align-right {
|
||||||
|
clear: right }
|
||||||
|
|
||||||
|
ol.simple, ul.simple {
|
||||||
|
margin-bottom: 1em }
|
||||||
|
|
||||||
|
ol.arabic {
|
||||||
|
list-style: decimal }
|
||||||
|
|
||||||
|
ol.loweralpha {
|
||||||
|
list-style: lower-alpha }
|
||||||
|
|
||||||
|
ol.upperalpha {
|
||||||
|
list-style: upper-alpha }
|
||||||
|
|
||||||
|
ol.lowerroman {
|
||||||
|
list-style: lower-roman }
|
||||||
|
|
||||||
|
ol.upperroman {
|
||||||
|
list-style: upper-roman }
|
||||||
|
|
||||||
|
p.attribution {
|
||||||
|
text-align: right ;
|
||||||
|
margin-left: 50% }
|
||||||
|
|
||||||
|
p.caption {
|
||||||
|
font-style: italic }
|
||||||
|
|
||||||
|
p.credits {
|
||||||
|
font-style: italic ;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
p.label {
|
||||||
|
white-space: nowrap }
|
||||||
|
|
||||||
|
p.rubric {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-size: larger ;
|
||||||
|
color: maroon ;
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
p.sidebar-title {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold ;
|
||||||
|
font-size: larger }
|
||||||
|
|
||||||
|
p.sidebar-subtitle {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
p.topic-title {
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
pre.address {
|
||||||
|
margin-bottom: 0 ;
|
||||||
|
margin-top: 0 ;
|
||||||
|
font-family: serif ;
|
||||||
|
font-size: 100% }
|
||||||
|
|
||||||
|
pre.literal-block, pre.doctest-block {
|
||||||
|
margin-left: 2em ;
|
||||||
|
margin-right: 2em }
|
||||||
|
|
||||||
|
span.classifier {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-style: oblique }
|
||||||
|
|
||||||
|
span.classifier-delimiter {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
span.interpreted {
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
span.option {
|
||||||
|
white-space: nowrap }
|
||||||
|
|
||||||
|
span.pre {
|
||||||
|
white-space: pre }
|
||||||
|
|
||||||
|
span.problematic {
|
||||||
|
color: red }
|
||||||
|
|
||||||
|
span.section-subtitle {
|
||||||
|
/* font-size relative to parent (h1..h6 element) */
|
||||||
|
font-size: 80% }
|
||||||
|
|
||||||
|
table.citation {
|
||||||
|
border-left: solid 1px gray;
|
||||||
|
margin-left: 1px }
|
||||||
|
|
||||||
|
table.docinfo {
|
||||||
|
margin: 2em 4em }
|
||||||
|
|
||||||
|
table.docutils {
|
||||||
|
margin-top: 0.5em ;
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
table.footnote {
|
||||||
|
border-left: solid 1px black;
|
||||||
|
margin-left: 1px }
|
||||||
|
|
||||||
|
table.docutils td, table.docutils th,
|
||||||
|
table.docinfo td, table.docinfo th {
|
||||||
|
padding-left: 0.5em ;
|
||||||
|
padding-right: 0.5em ;
|
||||||
|
vertical-align: top }
|
||||||
|
|
||||||
|
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||||
|
font-weight: bold ;
|
||||||
|
text-align: left ;
|
||||||
|
white-space: nowrap ;
|
||||||
|
padding-left: 0 }
|
||||||
|
|
||||||
|
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||||
|
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||||
|
font-size: 100% }
|
||||||
|
|
||||||
|
ul.auto-toc {
|
||||||
|
list-style-type: none }
|
BIN
doc/html/images/alert.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
doc/html/images/blank.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
doc/html/images/callouts/1.png
Normal file
After Width: | Height: | Size: 391 B |
BIN
doc/html/images/callouts/10.png
Normal file
After Width: | Height: | Size: 485 B |
BIN
doc/html/images/callouts/11.png
Normal file
After Width: | Height: | Size: 410 B |
BIN
doc/html/images/callouts/12.png
Normal file
After Width: | Height: | Size: 488 B |
BIN
doc/html/images/callouts/13.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
doc/html/images/callouts/14.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
doc/html/images/callouts/15.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
doc/html/images/callouts/2.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
doc/html/images/callouts/3.png
Normal file
After Width: | Height: | Size: 431 B |
BIN
doc/html/images/callouts/4.png
Normal file
After Width: | Height: | Size: 441 B |
BIN
doc/html/images/callouts/5.png
Normal file
After Width: | Height: | Size: 423 B |
BIN
doc/html/images/callouts/6.png
Normal file
After Width: | Height: | Size: 431 B |
BIN
doc/html/images/callouts/7.png
Normal file
After Width: | Height: | Size: 397 B |
BIN
doc/html/images/callouts/8.png
Normal file
After Width: | Height: | Size: 434 B |
BIN
doc/html/images/callouts/9.png
Normal file
After Width: | Height: | Size: 420 B |
BIN
doc/html/images/caution.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
doc/html/images/draft.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
doc/html/images/home.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
doc/html/images/important.png
Normal file
After Width: | Height: | Size: 722 B |
BIN
doc/html/images/next.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
doc/html/images/next_disabled.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/html/images/note.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
doc/html/images/prev.png
Normal file
After Width: | Height: | Size: 334 B |
BIN
doc/html/images/prev_disabled.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/html/images/smiley.png
Normal file
After Width: | Height: | Size: 867 B |
BIN
doc/html/images/tip.png
Normal file
After Width: | Height: | Size: 449 B |
BIN
doc/html/images/toc-blank.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
doc/html/images/toc-minus.png
Normal file
After Width: | Height: | Size: 259 B |
BIN
doc/html/images/toc-plus.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
doc/html/images/up.png
Normal file
After Width: | Height: | Size: 370 B |
BIN
doc/html/images/up_disabled.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/html/images/warning.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
56
doc/html/index.html
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||||
|
<title>Detail 1.0</title>
|
||||||
|
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
|
||||||
|
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||||
|
<link rel="home" href="index.html" title="Detail 1.0">
|
||||||
|
</head>
|
||||||
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||||
|
<table cellpadding="2" width="100%"><tr>
|
||||||
|
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
|
||||||
|
<td align="center"><a href="../../../../index.html">Home</a></td>
|
||||||
|
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
|
||||||
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||||
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||||
|
<td align="center"><a href="../../../../more/index.htm">More</a></td>
|
||||||
|
</tr></table>
|
||||||
|
<hr>
|
||||||
|
<div class="spirit-nav"></div>
|
||||||
|
<div class="article">
|
||||||
|
<div class="titlepage">
|
||||||
|
<div>
|
||||||
|
<div><h2 class="title">
|
||||||
|
<a name="detail"></a>Detail 1.0</h2></div>
|
||||||
|
<div><p class="copyright">Copyright © 2016 Rene Rivera</p></div>
|
||||||
|
<div><div class="legalnotice">
|
||||||
|
<a name="detail.legal"></a><p>
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||||
|
</p>
|
||||||
|
</div></div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div class="toc">
|
||||||
|
<p><b>Table of Contents</b></p>
|
||||||
|
<dl class="toc"><dt><span class="section"><a href="index.html#detail.introduction">Introduction</a></span></dt></dl>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
|
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||||
|
<a name="detail.introduction"></a><a class="link" href="index.html#detail.introduction" title="Introduction">Introduction</a>
|
||||||
|
</h2></div></div></div>
|
||||||
|
<p>
|
||||||
|
This library contains a set of header only utilities used internally by Boost
|
||||||
|
C++ Libraries to facilitate their implementation.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||||
|
<td align="left"><p><small>Last revised: June 21, 2016 at 03:48:00 GMT</small></p></td>
|
||||||
|
<td align="right"><div class="copyright-footer"></div></td>
|
||||||
|
</tr></table>
|
||||||
|
<hr>
|
||||||
|
<div class="spirit-nav"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
23
doc/html/minimal.css
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
<20> Copyright Beman Dawes, 2007
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
|
See www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
margin: 1em;
|
||||||
|
max-width : 8.5in;
|
||||||
|
}
|
||||||
|
|
||||||
|
table { margin: 0.5em; }
|
||||||
|
|
||||||
|
pre { background-color:#D7EEFF }
|
||||||
|
|
||||||
|
ins { background-color:#A0FFA0 }
|
||||||
|
del { background-color:#FFA0A0 }
|
||||||
|
|
||||||
|
/*** end ***/
|
11
doc/html/reference.css
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/*============================================================================
|
||||||
|
Copyright 2003-2004 Douglas Gregor
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||||
|
ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
============================================================================*/
|
||||||
|
|
||||||
|
PRE.synopsis {
|
||||||
|
background-color: #e0ffff;
|
||||||
|
border: thin solid blue;
|
||||||
|
padding: 1em
|
||||||
|
}
|
@ -15,9 +15,11 @@
|
|||||||
|
|
||||||
#include "boost/blank_fwd.hpp"
|
#include "boost/blank_fwd.hpp"
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_IOSTREAM)
|
||||||
#include <iosfwd> // for std::basic_ostream forward declare
|
#include <iosfwd> // for std::basic_ostream forward declare
|
||||||
|
|
||||||
#include "boost/detail/templated_streams.hpp"
|
#include "boost/detail/templated_streams.hpp"
|
||||||
|
#endif // BOOST_NO_IOSTREAM
|
||||||
|
|
||||||
#include "boost/mpl/bool.hpp"
|
#include "boost/mpl/bool.hpp"
|
||||||
#include "boost/type_traits/is_empty.hpp"
|
#include "boost/type_traits/is_empty.hpp"
|
||||||
#include "boost/type_traits/is_pod.hpp"
|
#include "boost/type_traits/is_pod.hpp"
|
||||||
@ -85,6 +87,8 @@ inline bool operator>(const blank&, const blank&)
|
|||||||
|
|
||||||
// streaming support
|
// streaming support
|
||||||
//
|
//
|
||||||
|
#if !defined(BOOST_NO_IOSTREAM)
|
||||||
|
|
||||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
||||||
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
||||||
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
||||||
@ -95,6 +99,8 @@ inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_NO_IOSTREAM
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // BOOST_BLANK_HPP
|
#endif // BOOST_BLANK_HPP
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2003-2007 Joaqu<EFBFBD>n M L<EFBFBD>pez Mu<EFBFBD>oz.
|
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||||
* 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
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/mpl/aux_/msvc_never_true.hpp>
|
|
||||||
#include <boost/mpl/eval_if.hpp>
|
#include <boost/mpl/eval_if.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@ -116,29 +115,6 @@ struct partial_std_allocator_rebind_to
|
|||||||
|
|
||||||
/* rebind operation in all other cases */
|
/* rebind operation in all other cases */
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
|
||||||
/* Workaround for a problem in MSVC with dependent template typedefs
|
|
||||||
* when doing rebinding of allocators.
|
|
||||||
* Modeled after <boost/mpl/aux_/msvc_dtw.hpp> (thanks, Aleksey!)
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<typename Allocator>
|
|
||||||
struct rebinder
|
|
||||||
{
|
|
||||||
template<bool> struct fake_allocator:Allocator{};
|
|
||||||
template<> struct fake_allocator<true>
|
|
||||||
{
|
|
||||||
template<typename Type> struct rebind{};
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Type>
|
|
||||||
struct result:
|
|
||||||
fake_allocator<mpl::aux::msvc_never_true<Allocator>::value>::
|
|
||||||
template rebind<Type>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
template<typename Allocator>
|
template<typename Allocator>
|
||||||
struct rebinder
|
struct rebinder
|
||||||
{
|
{
|
||||||
@ -149,7 +125,6 @@ struct rebinder
|
|||||||
rebind<Type>::other other;
|
rebind<Type>::other other;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename Allocator,typename Type>
|
template<typename Allocator,typename Type>
|
||||||
struct compliant_allocator_rebind_to
|
struct compliant_allocator_rebind_to
|
||||||
@ -178,12 +153,31 @@ void construct(void* p,const Type& t)
|
|||||||
new (p) Type(t);
|
new (p) Type(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
||||||
|
/* MSVC++ issues spurious warnings about unreferencend formal parameters
|
||||||
|
* in destroy<Type> when Type is a class with trivial dtor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4100)
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
void destroy(const Type* p)
|
void destroy(const Type* p)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
|
||||||
|
const_cast<Type*>(p)->~Type();
|
||||||
|
#else
|
||||||
p->~Type();
|
p->~Type();
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
} /* namespace boost::detail::allocator */
|
} /* namespace boost::detail::allocator */
|
||||||
|
|
||||||
} /* namespace boost::detail */
|
} /* namespace boost::detail */
|
||||||
|
47
include/boost/detail/bitmask.hpp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// boost/detail/bitmask.hpp ------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright Beman Dawes 2006
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
// Usage: enum foo { a=1, b=2, c=4 };
|
||||||
|
// BOOST_BITMASK( foo );
|
||||||
|
//
|
||||||
|
// void f( foo arg );
|
||||||
|
// ...
|
||||||
|
// f( a | c );
|
||||||
|
|
||||||
|
#ifndef BOOST_BITMASK_HPP
|
||||||
|
#define BOOST_BITMASK_HPP
|
||||||
|
|
||||||
|
#include <boost/cstdint.hpp>
|
||||||
|
|
||||||
|
#define BOOST_BITMASK(Bitmask) \
|
||||||
|
\
|
||||||
|
inline Bitmask operator| (Bitmask x , Bitmask y ) \
|
||||||
|
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||||
|
| static_cast<boost::int_least32_t>(y)); } \
|
||||||
|
\
|
||||||
|
inline Bitmask operator& (Bitmask x , Bitmask y ) \
|
||||||
|
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||||
|
& static_cast<boost::int_least32_t>(y)); } \
|
||||||
|
\
|
||||||
|
inline Bitmask operator^ (Bitmask x , Bitmask y ) \
|
||||||
|
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
|
||||||
|
^ static_cast<boost::int_least32_t>(y)); } \
|
||||||
|
\
|
||||||
|
inline Bitmask operator~ (Bitmask x ) \
|
||||||
|
{ return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
|
||||||
|
\
|
||||||
|
inline Bitmask & operator&=(Bitmask & x , Bitmask y) \
|
||||||
|
{ x = x & y ; return x ; } \
|
||||||
|
\
|
||||||
|
inline Bitmask & operator|=(Bitmask & x , Bitmask y) \
|
||||||
|
{ x = x | y ; return x ; } \
|
||||||
|
\
|
||||||
|
inline Bitmask & operator^=(Bitmask & x , Bitmask y) \
|
||||||
|
{ x = x ^ y ; return x ; }
|
||||||
|
|
||||||
|
#endif // BOOST_BITMASK_HPP
|
||||||
|
|
@ -24,11 +24,7 @@
|
|||||||
#include <exception> // for exception, bad_exception
|
#include <exception> // for exception, bad_exception
|
||||||
#include <stdexcept> // for std exception hierarchy
|
#include <stdexcept> // for std exception hierarchy
|
||||||
#include <boost/cstdlib.hpp> // for exit codes
|
#include <boost/cstdlib.hpp> // for exit codes
|
||||||
# if __GNUC__ != 2 || __GNUC_MINOR__ > 96
|
#include <ostream> // for ostream
|
||||||
# include <ostream> // for ostream
|
|
||||||
# else
|
|
||||||
# include <iostream> // workaround GNU missing ostream header
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
|
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
|
||||||
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
|
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
|
||||||
|
157
include/boost/detail/container_fwd.hpp
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
|
||||||
|
// Copyright 2005-2011 Daniel James.
|
||||||
|
// 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)
|
||||||
|
|
||||||
|
// Note: if you change this include guard, you also need to change
|
||||||
|
// container_fwd_compile_fail.cpp
|
||||||
|
#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
|
||||||
|
#define BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && \
|
||||||
|
!defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// //
|
||||||
|
// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
|
||||||
|
// forward declare standard containers. //
|
||||||
|
// //
|
||||||
|
// BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
|
||||||
|
// normally doesn't. //
|
||||||
|
// //
|
||||||
|
// BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. //
|
||||||
|
// //
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
||||||
|
# if defined(BOOST_DETAIL_CONTAINER_FWD)
|
||||||
|
// Force forward declarations.
|
||||||
|
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
||||||
|
// STLport
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif defined(__LIBCOMO__)
|
||||||
|
// Comeau STL:
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
|
||||||
|
// Rogue Wave library:
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif defined(_LIBCPP_VERSION)
|
||||||
|
// libc++
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||||
|
// GNU libstdc++ 3
|
||||||
|
//
|
||||||
|
// Disable forwarding for all recent versions, as the library has a
|
||||||
|
// versioned namespace mode, and I don't know how to detect it.
|
||||||
|
# if __GLIBCXX__ >= 20070513 \
|
||||||
|
|| defined(_GLIBCXX_DEBUG) \
|
||||||
|
|| defined(_GLIBCXX_PARALLEL) \
|
||||||
|
|| defined(_GLIBCXX_PROFILE)
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# else
|
||||||
|
# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
|
||||||
|
# define BOOST_CONTAINER_FWD_COMPLEX_STRUCT
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# elif defined(__STL_CONFIG_H)
|
||||||
|
// generic SGI STL
|
||||||
|
//
|
||||||
|
// Forward declaration seems to be okay, but it has a couple of odd
|
||||||
|
// implementations.
|
||||||
|
# define BOOST_CONTAINER_FWD_BAD_BITSET
|
||||||
|
# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
|
||||||
|
# define BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||||
|
# endif
|
||||||
|
# elif defined(__MSL_CPP__)
|
||||||
|
// MSL standard lib:
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif defined(__IBMCPP__)
|
||||||
|
// The default VACPP std lib, forward declaration seems to be fine.
|
||||||
|
# elif defined(MSIPL_COMPILE_H)
|
||||||
|
// Modena C++ standard library
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
|
||||||
|
// Dinkumware Library (this has to appear after any possible replacement
|
||||||
|
// libraries)
|
||||||
|
# else
|
||||||
|
# define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
|
||||||
|
|
||||||
|
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
|
||||||
|
!defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <bitset>
|
||||||
|
#include <string>
|
||||||
|
#include <complex>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||||
|
#include <deque>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
||||||
|
#include <bitset>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template <class T> class allocator;
|
||||||
|
template <class charT, class traits, class Allocator> class basic_string;
|
||||||
|
|
||||||
|
template <class charT> struct char_traits;
|
||||||
|
|
||||||
|
#if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
|
||||||
|
template <class T> struct complex;
|
||||||
|
#else
|
||||||
|
template <class T> class complex;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
|
||||||
|
template <class T, class Allocator> class deque;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class T, class Allocator> class list;
|
||||||
|
template <class T, class Allocator> class vector;
|
||||||
|
template <class Key, class T, class Compare, class Allocator> class map;
|
||||||
|
template <class Key, class T, class Compare, class Allocator>
|
||||||
|
class multimap;
|
||||||
|
template <class Key, class Compare, class Allocator> class set;
|
||||||
|
template <class Key, class Compare, class Allocator> class multiset;
|
||||||
|
|
||||||
|
#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
|
||||||
|
template <size_t N> class bitset;
|
||||||
|
#endif
|
||||||
|
template <class T1, class T2> struct pair;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
|
||||||
|
// !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||||
|
|
||||||
|
#endif
|
@ -1,73 +0,0 @@
|
|||||||
// Copyright 2005 Caleb Epstein
|
|
||||||
// Copyright 2006 John Maddock
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
|
||||||
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1997
|
|
||||||
* Silicon Graphics Computer Systems, Inc.
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation. Silicon Graphics makes no
|
|
||||||
* representations about the suitability of this software for any
|
|
||||||
* purpose. It is provided "as is" without express or implied warranty.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright notice reproduced from <boost/detail/limits.hpp>, from
|
|
||||||
* which this code was originally taken.
|
|
||||||
*
|
|
||||||
* Modified by Caleb Epstein to use <endian.h> with GNU libc and to
|
|
||||||
* defined the BOOST_ENDIAN macro.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_ENDIAN_HPP
|
|
||||||
#define BOOST_DETAIL_ENDIAN_HPP
|
|
||||||
|
|
||||||
// GNU libc offers the helpful header <endian.h> which defines
|
|
||||||
// __BYTE_ORDER
|
|
||||||
|
|
||||||
#if defined (__GLIBC__)
|
|
||||||
# include <endian.h>
|
|
||||||
# if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
|
||||||
# define BOOST_LITTLE_ENDIAN
|
|
||||||
# elif (__BYTE_ORDER == __BIG_ENDIAN)
|
|
||||||
# define BOOST_BIG_ENDIAN
|
|
||||||
# elif (__BYTE_ORDER == __PDP_ENDIAN)
|
|
||||||
# define BOOST_PDP_ENDIAN
|
|
||||||
# else
|
|
||||||
# error Unknown machine endianness detected.
|
|
||||||
# endif
|
|
||||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
|
||||||
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
|
|
||||||
# define BOOST_BIG_ENDIAN
|
|
||||||
# define BOOST_BYTE_ORDER 4321
|
|
||||||
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
|
|
||||||
# define BOOST_LITTLE_ENDIAN
|
|
||||||
# define BOOST_BYTE_ORDER 1234
|
|
||||||
#elif defined(__sparc) || defined(__sparc__) \
|
|
||||||
|| defined(_POWER) || defined(__powerpc__) \
|
|
||||||
|| defined(__ppc__) || defined(__hpux) \
|
|
||||||
|| defined(_MIPSEB) || defined(_POWER) \
|
|
||||||
|| defined(__s390__)
|
|
||||||
# define BOOST_BIG_ENDIAN
|
|
||||||
# define BOOST_BYTE_ORDER 4321
|
|
||||||
#elif defined(__i386__) || defined(__alpha__) \
|
|
||||||
|| defined(__ia64) || defined(__ia64__) \
|
|
||||||
|| defined(_M_IX86) || defined(_M_IA64) \
|
|
||||||
|| defined(_M_ALPHA) || defined(__amd64) \
|
|
||||||
|| defined(__amd64__) || defined(_M_AMD64) \
|
|
||||||
|| defined(__x86_64) || defined(__x86_64__) \
|
|
||||||
|| defined(_M_X64)
|
|
||||||
|
|
||||||
# define BOOST_LITTLE_ENDIAN
|
|
||||||
# define BOOST_BYTE_ORDER 1234
|
|
||||||
#else
|
|
||||||
# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
101
include/boost/detail/fenv.hpp
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2010 Bryce Lelbach
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_FENV_H)
|
||||||
|
#error This platform does not have a floating point environment
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_DETAIL_FENV_HPP)
|
||||||
|
#define BOOST_DETAIL_FENV_HPP
|
||||||
|
|
||||||
|
/* If we're using clang + glibc, we have to get hacky.
|
||||||
|
* See http://llvm.org/bugs/show_bug.cgi?id=6907 */
|
||||||
|
#if defined(__clang__) && (__clang_major__ < 3) && \
|
||||||
|
defined(__GNU_LIBRARY__) && /* up to version 5 */ \
|
||||||
|
defined(__GLIBC__) && /* version 6 + */ \
|
||||||
|
!defined(_FENV_H)
|
||||||
|
#define _FENV_H
|
||||||
|
|
||||||
|
#include <features.h>
|
||||||
|
#include <bits/fenv.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
extern int fegetexceptflag (fexcept_t*, int) __THROW;
|
||||||
|
extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
|
||||||
|
extern int feclearexcept (int) __THROW;
|
||||||
|
extern int feraiseexcept (int) __THROW;
|
||||||
|
extern int fetestexcept (int) __THROW;
|
||||||
|
extern int fegetround (void) __THROW;
|
||||||
|
extern int fesetround (int) __THROW;
|
||||||
|
extern int fegetenv (fenv_t*) __THROW;
|
||||||
|
extern int fesetenv (__const fenv_t*) __THROW;
|
||||||
|
extern int feupdateenv (__const fenv_t*) __THROW;
|
||||||
|
extern int feholdexcept (fenv_t*) __THROW;
|
||||||
|
|
||||||
|
#ifdef __USE_GNU
|
||||||
|
extern int feenableexcept (int) __THROW;
|
||||||
|
extern int fedisableexcept (int) __THROW;
|
||||||
|
extern int fegetexcept (void) __THROW;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace std { namespace tr1 {
|
||||||
|
using ::fenv_t;
|
||||||
|
using ::fexcept_t;
|
||||||
|
using ::fegetexceptflag;
|
||||||
|
using ::fesetexceptflag;
|
||||||
|
using ::feclearexcept;
|
||||||
|
using ::feraiseexcept;
|
||||||
|
using ::fetestexcept;
|
||||||
|
using ::fegetround;
|
||||||
|
using ::fesetround;
|
||||||
|
using ::fegetenv;
|
||||||
|
using ::fesetenv;
|
||||||
|
using ::feupdateenv;
|
||||||
|
using ::feholdexcept;
|
||||||
|
} }
|
||||||
|
|
||||||
|
#elif defined(__MINGW32__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
|
||||||
|
|
||||||
|
// MinGW (32-bit) has a bug in mingw32/bits/c++config.h, it does not define _GLIBCXX_HAVE_FENV_H,
|
||||||
|
// which prevents the C fenv.h header contents to be included in the C++ wrapper header fenv.h. This is at least
|
||||||
|
// the case with gcc 4.8.1 packages tested so far, up to 4.8.1-4. Note that there is no issue with
|
||||||
|
// MinGW-w64.
|
||||||
|
// To work around the bug we avoid including the C++ wrapper header and include the C header directly
|
||||||
|
// and import all relevant symbols into std:: ourselves.
|
||||||
|
|
||||||
|
#include <../include/fenv.h>
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
using ::fenv_t;
|
||||||
|
using ::fexcept_t;
|
||||||
|
using ::fegetexceptflag;
|
||||||
|
using ::fesetexceptflag;
|
||||||
|
using ::feclearexcept;
|
||||||
|
using ::feraiseexcept;
|
||||||
|
using ::fetestexcept;
|
||||||
|
using ::fegetround;
|
||||||
|
using ::fesetround;
|
||||||
|
using ::fegetenv;
|
||||||
|
using ::fesetenv;
|
||||||
|
using ::feupdateenv;
|
||||||
|
using ::feholdexcept;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
|
||||||
|
|
||||||
|
#if defined(__SUNPRO_CC) /* lol suncc */
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <fenv.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* BOOST_DETAIL_FENV_HPP */
|
@ -57,9 +57,7 @@ namespace boost
|
|||||||
identifier() {}
|
identifier() {}
|
||||||
explicit identifier( value_type v ) : m_value(v) {}
|
explicit identifier( value_type v ) : m_value(v) {}
|
||||||
|
|
||||||
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround
|
|
||||||
private:
|
private:
|
||||||
#endif
|
|
||||||
T m_value;
|
T m_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
283
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
@ -16,7 +16,6 @@
|
|||||||
# include <boost/type_traits/remove_reference.hpp>
|
# include <boost/type_traits/remove_reference.hpp>
|
||||||
# include <boost/type_traits/remove_pointer.hpp>
|
# include <boost/type_traits/remove_pointer.hpp>
|
||||||
|
|
||||||
# include <boost/type_traits/detail/ice_and.hpp>
|
|
||||||
# include <boost/detail/workaround.hpp>
|
# include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
# include <boost/mpl/eval_if.hpp>
|
# include <boost/mpl/eval_if.hpp>
|
||||||
@ -26,15 +25,11 @@
|
|||||||
# include <boost/mpl/not.hpp>
|
# include <boost/mpl/not.hpp>
|
||||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||||
|
|
||||||
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
# include <boost/detail/is_function_ref_tester.hpp>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
namespace boost { namespace detail {
|
||||||
|
|
||||||
namespace indirect_traits {
|
namespace indirect_traits {
|
||||||
|
|
||||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_reference_to_const : mpl::false_
|
struct is_reference_to_const : mpl::false_
|
||||||
{
|
{
|
||||||
@ -199,284 +194,6 @@ struct is_pointer_to_class
|
|||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
|
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
|
||||||
};
|
};
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
using namespace boost::detail::is_function_ref_tester_;
|
|
||||||
|
|
||||||
typedef char (&inner_yes_type)[3];
|
|
||||||
typedef char (&inner_no_type)[2];
|
|
||||||
typedef char (&outer_no_type)[1];
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
struct is_const_help
|
|
||||||
{
|
|
||||||
typedef typename mpl::if_<
|
|
||||||
is_const<V>
|
|
||||||
, inner_yes_type
|
|
||||||
, inner_no_type
|
|
||||||
>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
struct is_volatile_help
|
|
||||||
{
|
|
||||||
typedef typename mpl::if_<
|
|
||||||
is_volatile<V>
|
|
||||||
, inner_yes_type
|
|
||||||
, inner_no_type
|
|
||||||
>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
struct is_pointer_help
|
|
||||||
{
|
|
||||||
typedef typename mpl::if_<
|
|
||||||
is_pointer<V>
|
|
||||||
, inner_yes_type
|
|
||||||
, inner_no_type
|
|
||||||
>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
struct is_class_help
|
|
||||||
{
|
|
||||||
typedef typename mpl::if_<
|
|
||||||
is_class<V>
|
|
||||||
, inner_yes_type
|
|
||||||
, inner_no_type
|
|
||||||
>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function_aux
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function
|
|
||||||
: mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_function_aux
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type));
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_function
|
|
||||||
: mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
struct false_helper1
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply : mpl::false_
|
|
||||||
{
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_const_help<V>::type reference_to_const_helper(V&);
|
|
||||||
outer_no_type
|
|
||||||
reference_to_const_helper(...);
|
|
||||||
|
|
||||||
struct true_helper1
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type));
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <bool ref = true>
|
|
||||||
struct is_reference_to_const_helper1 : true_helper1
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_reference_to_const_helper1<false> : false_helper1
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_const
|
|
||||||
: is_reference_to_const_helper1<is_reference<T>::value>::template apply<T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <bool ref = true>
|
|
||||||
struct is_reference_to_non_const_helper1
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
|
|
||||||
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_reference_to_non_const_helper1<false> : false_helper1
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_non_const
|
|
||||||
: is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_volatile_help<V>::type reference_to_volatile_helper(V&);
|
|
||||||
outer_no_type
|
|
||||||
reference_to_volatile_helper(...);
|
|
||||||
|
|
||||||
template <bool ref = true>
|
|
||||||
struct is_reference_to_volatile_helper1
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_reference_to_volatile_helper1<false> : false_helper1
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_volatile
|
|
||||||
: is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
|
|
||||||
outer_no_type reference_to_pointer_helper(...);
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct reference_to_pointer_impl
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_pointer
|
|
||||||
: mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_function_pointer
|
|
||||||
: mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_member_function_pointer_help
|
|
||||||
: mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&);
|
|
||||||
outer_no_type member_function_pointer_helper(...);
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_member_function_aux
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type));
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_member_function_pointer
|
|
||||||
: mpl::if_<
|
|
||||||
is_reference<T>
|
|
||||||
, is_pointer_to_member_function_aux<T>
|
|
||||||
, mpl::bool_<false>
|
|
||||||
>::type
|
|
||||||
{
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_class_help<V>::type reference_to_class_helper(V const volatile&);
|
|
||||||
outer_no_type reference_to_class_helper(...);
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_reference_to_class
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= (is_reference<T>::value
|
|
||||||
& (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type)))
|
|
||||||
);
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename V>
|
|
||||||
typename is_class_help<V>::type pointer_to_class_helper(V const volatile*);
|
|
||||||
outer_no_type pointer_to_class_helper(...);
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_pointer_to_class
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value
|
|
||||||
= (is_pointer<T>::value
|
|
||||||
&& sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
|
|
||||||
);
|
|
||||||
typedef mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,130 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// boost/detail/interlocked.hpp
|
|
||||||
//
|
|
||||||
// Copyright 2005 Peter Dimov
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
|
||||||
|
|
||||||
# include <windows.h>
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
|
||||||
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
|
|
||||||
|
|
||||||
#elif defined(_WIN32_WCE)
|
|
||||||
|
|
||||||
// under Windows CE we still have old-style Interlocked* functions
|
|
||||||
|
|
||||||
extern "C" long __cdecl InterlockedIncrement( long* );
|
|
||||||
extern "C" long __cdecl InterlockedDecrement( long* );
|
|
||||||
extern "C" long __cdecl InterlockedCompareExchange( long*, long, long );
|
|
||||||
extern "C" long __cdecl InterlockedExchange( long*, long );
|
|
||||||
extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
|
||||||
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
|
||||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare)))
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
|
||||||
((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange)))
|
|
||||||
|
|
||||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
|
||||||
|
|
||||||
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
|
||||||
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
|
|
||||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
|
||||||
extern "C" long __cdecl _InterlockedExchange( long volatile *, long);
|
|
||||||
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long);
|
|
||||||
|
|
||||||
# pragma intrinsic( _InterlockedIncrement )
|
|
||||||
# pragma intrinsic( _InterlockedDecrement )
|
|
||||||
# pragma intrinsic( _InterlockedCompareExchange )
|
|
||||||
# pragma intrinsic( _InterlockedExchange )
|
|
||||||
# pragma intrinsic( _InterlockedExchangeAdd )
|
|
||||||
|
|
||||||
# if defined(_M_IA64) || defined(_M_AMD64)
|
|
||||||
|
|
||||||
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
|
||||||
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
|
||||||
|
|
||||||
# pragma intrinsic( _InterlockedCompareExchangePointer )
|
|
||||||
# pragma intrinsic( _InterlockedExchangePointer )
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
|
||||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
|
||||||
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
|
|
||||||
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
|
||||||
|
|
||||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
|
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
|
|
||||||
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
|
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
|
||||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
|
||||||
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
# error "Interlocked intrinsics not available"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
|
@ -1,135 +0,0 @@
|
|||||||
|
|
||||||
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
|
|
||||||
// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
#if !defined(BOOST_PP_IS_ITERATING)
|
|
||||||
|
|
||||||
///// header body
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
|
||||||
|
|
||||||
#include "boost/type_traits/detail/yes_no_type.hpp"
|
|
||||||
#include "boost/type_traits/config.hpp"
|
|
||||||
|
|
||||||
#if defined(BOOST_TT_PREPROCESSING_MODE)
|
|
||||||
# include "boost/preprocessor/iterate.hpp"
|
|
||||||
# include "boost/preprocessor/enum_params.hpp"
|
|
||||||
# include "boost/preprocessor/comma_if.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
namespace detail {
|
|
||||||
namespace is_function_ref_tester_ {
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
boost::type_traits::no_type BOOST_TT_DECL is_function_ref_tester(T& ...);
|
|
||||||
|
|
||||||
#if !defined(BOOST_TT_PREPROCESSING_MODE)
|
|
||||||
// preprocessor-generated part, don't edit by hand!
|
|
||||||
|
|
||||||
template <class R>
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(), int);
|
|
||||||
|
|
||||||
template <class R,class T0 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23), int);
|
|
||||||
|
|
||||||
template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23,class T24 >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24), int);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
|
||||||
(3, (0, 25, "boost/type_traits/detail/is_function_ref_tester.hpp"))
|
|
||||||
#include BOOST_PP_ITERATE()
|
|
||||||
|
|
||||||
#endif // BOOST_TT_PREPROCESSING_MODE
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace python
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
|
|
||||||
|
|
||||||
///// iteration
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define i BOOST_PP_FRAME_ITERATION(1)
|
|
||||||
|
|
||||||
template <class R BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T) >
|
|
||||||
boost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i,T)), int);
|
|
||||||
|
|
||||||
#undef i
|
|
||||||
#endif // BOOST_PP_IS_ITERATING
|
|
@ -4,16 +4,13 @@
|
|||||||
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
||||||
# define IS_INCREMENTABLE_DWA200415_HPP
|
# define IS_INCREMENTABLE_DWA200415_HPP
|
||||||
|
|
||||||
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
# include <boost/type_traits/integral_constant.hpp>
|
||||||
# include <boost/type_traits/remove_cv.hpp>
|
# include <boost/type_traits/remove_cv.hpp>
|
||||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||||
# include <boost/mpl/bool.hpp>
|
# include <boost/mpl/bool.hpp>
|
||||||
# include <boost/detail/workaround.hpp>
|
# include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
// Must be the last include
|
namespace boost { namespace detail {
|
||||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
// is_incrementable<T> metafunction
|
// is_incrementable<T> metafunction
|
||||||
//
|
//
|
||||||
@ -27,7 +24,7 @@ namespace is_incrementable_
|
|||||||
// a type returned from operator++ when no increment is found in the
|
// a type returned from operator++ when no increment is found in the
|
||||||
// type's own namespace
|
// type's own namespace
|
||||||
struct tag {};
|
struct tag {};
|
||||||
|
|
||||||
// any soaks up implicit conversions and makes the following
|
// any soaks up implicit conversions and makes the following
|
||||||
// operator++ less-preferred than any other such operator that
|
// operator++ less-preferred than any other such operator that
|
||||||
// might be found via ADL.
|
// might be found via ADL.
|
||||||
@ -35,7 +32,7 @@ namespace is_incrementable_
|
|||||||
|
|
||||||
// This is a last-resort operator++ for when none other is found
|
// This is a last-resort operator++ for when none other is found
|
||||||
# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
|
# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace is_incrementable_2
|
namespace is_incrementable_2
|
||||||
@ -47,34 +44,33 @@ using namespace is_incrementable_2;
|
|||||||
|
|
||||||
namespace is_incrementable_
|
namespace is_incrementable_
|
||||||
{
|
{
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
|
||||||
tag operator++(any const&);
|
tag operator++(any const&);
|
||||||
tag operator++(any const&,int);
|
tag operator++(any const&,int);
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
# endif
|
||||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
|
||||||
|
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
|
||||||
# define BOOST_comma(a,b) (a)
|
# define BOOST_comma(a,b) (a)
|
||||||
# else
|
# else
|
||||||
// In case an operator++ is found that returns void, we'll use ++x,0
|
// In case an operator++ is found that returns void, we'll use ++x,0
|
||||||
tag operator,(tag,int);
|
tag operator,(tag,int);
|
||||||
# define BOOST_comma(a,b) (a,b)
|
# define BOOST_comma(a,b) (a,b)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable:4913) // Warning about operator,
|
# pragma warning(disable:4913) // Warning about operator,
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// two check overloads help us identify which operator++ was picked
|
// two check overloads help us identify which operator++ was picked
|
||||||
char (& check(tag) )[2];
|
char (& check_(tag) )[2];
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
char check(T const&);
|
char check_(T const&);
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct impl
|
struct impl
|
||||||
@ -83,7 +79,7 @@ namespace is_incrementable_
|
|||||||
|
|
||||||
BOOST_STATIC_CONSTANT(
|
BOOST_STATIC_CONSTANT(
|
||||||
bool
|
bool
|
||||||
, value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1
|
, value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -94,39 +90,34 @@ namespace is_incrementable_
|
|||||||
|
|
||||||
BOOST_STATIC_CONSTANT(
|
BOOST_STATIC_CONSTANT(
|
||||||
bool
|
bool
|
||||||
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
|
, value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# undef BOOST_comma
|
# undef BOOST_comma
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_incrementable
|
struct is_incrementable :
|
||||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
public boost::integral_constant<bool, boost::detail::is_incrementable_::impl<T>::value>
|
||||||
{
|
{
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl<T>::value)
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
|
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_postfix_incrementable
|
struct is_postfix_incrementable :
|
||||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
public boost::integral_constant<bool, boost::detail::is_incrementable_::postfix_impl<T>::value>
|
||||||
{
|
{
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
|
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
|
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable)
|
|
||||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
# include <boost/type_traits/detail/bool_trait_undef.hpp>
|
# include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||||
|
56
include/boost/detail/is_sorted.hpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*==============================================================================
|
||||||
|
Copyright (c) 2010-2011 Bryce Lelbach
|
||||||
|
|
||||||
|
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)
|
||||||
|
==============================================================================*/
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_SORTED_HPP
|
||||||
|
#define BOOST_DETAIL_SORTED_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/iterator.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
|
||||||
|
template<class Iterator, class Comp>
|
||||||
|
inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) {
|
||||||
|
if (first == last)
|
||||||
|
return last;
|
||||||
|
|
||||||
|
Iterator it = first; ++it;
|
||||||
|
|
||||||
|
for (; it != last; first = it, ++it)
|
||||||
|
if (c(*it, *first))
|
||||||
|
return it;
|
||||||
|
|
||||||
|
return it;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Iterator>
|
||||||
|
inline Iterator is_sorted_until (Iterator first, Iterator last) {
|
||||||
|
typedef typename boost::detail::iterator_traits<Iterator>::value_type
|
||||||
|
value_type;
|
||||||
|
|
||||||
|
typedef std::less<value_type> c;
|
||||||
|
|
||||||
|
return ::boost::detail::is_sorted_until(first, last, c());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Iterator, class Comp>
|
||||||
|
inline bool is_sorted (Iterator first, Iterator last, Comp c) {
|
||||||
|
return ::boost::detail::is_sorted_until(first, last, c) == last;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Iterator>
|
||||||
|
inline bool is_sorted (Iterator first, Iterator last) {
|
||||||
|
return ::boost::detail::is_sorted_until(first, last) == last;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // detail
|
||||||
|
} // boost
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_SORTED_HPP
|
||||||
|
|
34
include/boost/detail/is_xxx.hpp
Executable file → Normal file
@ -8,39 +8,6 @@
|
|||||||
# include <boost/mpl/bool.hpp>
|
# include <boost/mpl/bool.hpp>
|
||||||
# include <boost/preprocessor/enum_params.hpp>
|
# include <boost/preprocessor/enum_params.hpp>
|
||||||
|
|
||||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
# include <boost/type_traits/is_reference.hpp>
|
|
||||||
# include <boost/type_traits/add_reference.hpp>
|
|
||||||
|
|
||||||
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
|
||||||
template <class X_> \
|
|
||||||
struct is_##name \
|
|
||||||
{ \
|
|
||||||
typedef char yes; \
|
|
||||||
typedef char (&no)[2]; \
|
|
||||||
\
|
|
||||||
static typename add_reference<X_>::type dummy; \
|
|
||||||
\
|
|
||||||
struct helpers \
|
|
||||||
{ \
|
|
||||||
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
|
|
||||||
static yes test( \
|
|
||||||
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
template <class U> \
|
|
||||||
static no test(U&, ...); \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
BOOST_STATIC_CONSTANT( \
|
|
||||||
bool, value \
|
|
||||||
= !is_reference<X_>::value \
|
|
||||||
& (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
|
|
||||||
\
|
|
||||||
typedef mpl::bool_<value> type; \
|
|
||||||
};
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||||
template <class T> \
|
template <class T> \
|
||||||
@ -56,6 +23,5 @@ struct is_##name< \
|
|||||||
{ \
|
{ \
|
||||||
};
|
};
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
||||||
|
@ -1,494 +0,0 @@
|
|||||||
// (C) Copyright David Abrahams 2002.
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// Boost versions of
|
|
||||||
//
|
|
||||||
// std::iterator_traits<>::iterator_category
|
|
||||||
// std::iterator_traits<>::difference_type
|
|
||||||
// std::distance()
|
|
||||||
//
|
|
||||||
// ...for all compilers and iterators
|
|
||||||
//
|
|
||||||
// Additionally, if X is a pointer
|
|
||||||
// std::iterator_traits<X>::pointer
|
|
||||||
|
|
||||||
// Otherwise, if partial specialization is supported or X is not a pointer
|
|
||||||
// std::iterator_traits<X>::value_type
|
|
||||||
// std::iterator_traits<X>::pointer
|
|
||||||
// std::iterator_traits<X>::reference
|
|
||||||
//
|
|
||||||
// See http://www.boost.org for most recent version including documentation.
|
|
||||||
|
|
||||||
// Revision History
|
|
||||||
// 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams)
|
|
||||||
// 03 Mar 2001 - Put all implementation into namespace
|
|
||||||
// boost::detail::iterator_traits_. Some progress made on fixes
|
|
||||||
// for Intel compiler. (David Abrahams)
|
|
||||||
// 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few
|
|
||||||
// places. (Jeremy Siek)
|
|
||||||
// 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and
|
|
||||||
// no_type from type_traits.hpp; stopped trying to remove_cv
|
|
||||||
// before detecting is_pointer, in honor of the new type_traits
|
|
||||||
// semantics. (David Abrahams)
|
|
||||||
// 13 Feb 2001 - Make it work with nearly all standard-conforming iterators
|
|
||||||
// under raw VC6. The one category remaining which will fail is
|
|
||||||
// that of iterators derived from std::iterator but not
|
|
||||||
// boost::iterator and which redefine difference_type.
|
|
||||||
// 11 Feb 2001 - Clean away code which can never be used (David Abrahams)
|
|
||||||
// 09 Feb 2001 - Always have a definition for each traits member, even if it
|
|
||||||
// can't be properly deduced. These will be incomplete types in
|
|
||||||
// some cases (undefined<void>), but it helps suppress MSVC errors
|
|
||||||
// elsewhere (David Abrahams)
|
|
||||||
// 07 Feb 2001 - Support for more of the traits members where possible, making
|
|
||||||
// this useful as a replacement for std::iterator_traits<T> when
|
|
||||||
// used as a default template parameter.
|
|
||||||
// 06 Feb 2001 - Removed useless #includes of standard library headers
|
|
||||||
// (David Abrahams)
|
|
||||||
|
|
||||||
#ifndef ITERATOR_DWA122600_HPP_
|
|
||||||
# define ITERATOR_DWA122600_HPP_
|
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
|
||||||
# include <iterator>
|
|
||||||
|
|
||||||
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
|
|
||||||
// partial specialization: instead of an iterator_category typedef, the standard
|
|
||||||
// container iterators have _Iterator_category.
|
|
||||||
//
|
|
||||||
// Also, whether debugging is enabled or not, there is a broken specialization
|
|
||||||
// of std::iterator<output_iterator_tag,void,void,void,void> which has no
|
|
||||||
// typedefs but iterator_category.
|
|
||||||
# if defined(__SGI_STL_PORT)
|
|
||||||
|
|
||||||
# if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG)
|
|
||||||
# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
|
||||||
|
|
||||||
# endif // STLPort <= 4.1b4 && no partial specialization
|
|
||||||
|
|
||||||
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \
|
|
||||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
|
||||||
&& !defined(BOOST_MSVC_STD_ITERATOR)
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
// Define a new template so it can be specialized
|
|
||||||
template <class Iterator>
|
|
||||||
struct iterator_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{};
|
|
||||||
using std::distance;
|
|
||||||
|
|
||||||
}} // namespace boost::detail
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
|
||||||
&& !defined(BOOST_MSVC_STD_ITERATOR)
|
|
||||||
|
|
||||||
// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
// Rogue Wave Standard Library fools itself into thinking partial
|
|
||||||
// specialization is missing on some platforms (e.g. Sun), so fails to
|
|
||||||
// supply iterator_traits!
|
|
||||||
template <class Iterator>
|
|
||||||
struct iterator_traits
|
|
||||||
{
|
|
||||||
typedef typename Iterator::value_type value_type;
|
|
||||||
typedef typename Iterator::reference reference;
|
|
||||||
typedef typename Iterator::pointer pointer;
|
|
||||||
typedef typename Iterator::difference_type difference_type;
|
|
||||||
typedef typename Iterator::iterator_category iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct iterator_traits<T*>
|
|
||||||
{
|
|
||||||
typedef T value_type;
|
|
||||||
typedef T& reference;
|
|
||||||
typedef T* pointer;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct iterator_traits<T const*>
|
|
||||||
{
|
|
||||||
typedef T value_type;
|
|
||||||
typedef T const& reference;
|
|
||||||
typedef T const* pointer;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace boost::detail
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# include <boost/type_traits/remove_const.hpp>
|
|
||||||
# include <boost/type_traits/detail/yes_no_type.hpp>
|
|
||||||
# include <boost/type_traits/is_pointer.hpp>
|
|
||||||
|
|
||||||
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
# include <boost/type_traits/is_same.hpp>
|
|
||||||
# include <boost/type_traits/remove_pointer.hpp>
|
|
||||||
# endif
|
|
||||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
|
||||||
# include <boost/type_traits/is_base_and_derived.hpp>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# include <boost/mpl/if.hpp>
|
|
||||||
# include <boost/mpl/has_xxx.hpp>
|
|
||||||
# include <cstddef>
|
|
||||||
|
|
||||||
// should be the last #include
|
|
||||||
# include "boost/type_traits/detail/bool_trait_def.hpp"
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer)
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type)
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
|
|
||||||
|
|
||||||
// is_mutable_iterator --
|
|
||||||
//
|
|
||||||
// A metafunction returning true iff T is a mutable iterator type
|
|
||||||
// with a nested value_type. Will only work portably with iterators
|
|
||||||
// whose operator* returns a reference, but that seems to be OK for
|
|
||||||
// the iterators supplied by Dinkumware. Some input iterators may
|
|
||||||
// compile-time if they arrive here, and if the compiler is strict
|
|
||||||
// about not taking the address of an rvalue.
|
|
||||||
|
|
||||||
// This one detects ordinary mutable iterators - the result of
|
|
||||||
// operator* is convertible to the value_type.
|
|
||||||
template <class T>
|
|
||||||
type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*);
|
|
||||||
|
|
||||||
// Since you can't take the address of an rvalue, the guts of
|
|
||||||
// is_mutable_iterator_impl will fail if we use &*t directly. This
|
|
||||||
// makes sure we can still work with non-lvalue iterators.
|
|
||||||
template <class T> T* mutable_iterator_lvalue_helper(T& x);
|
|
||||||
int mutable_iterator_lvalue_helper(...);
|
|
||||||
|
|
||||||
|
|
||||||
// This one detects output iterators such as ostream_iterator which
|
|
||||||
// return references to themselves.
|
|
||||||
template <class T>
|
|
||||||
type_traits::yes_type is_mutable_iterator_helper(T const*, T const*);
|
|
||||||
|
|
||||||
type_traits::no_type is_mutable_iterator_helper(...);
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct is_mutable_iterator_impl
|
|
||||||
{
|
|
||||||
static T t;
|
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value = sizeof(
|
|
||||||
detail::is_mutable_iterator_helper(
|
|
||||||
(T*)0
|
|
||||||
, mutable_iterator_lvalue_helper(*t) // like &*t
|
|
||||||
))
|
|
||||||
== sizeof(type_traits::yes_type)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
|
||||||
is_mutable_iterator,T,::boost::detail::is_mutable_iterator_impl<T>::value)
|
|
||||||
|
|
||||||
|
|
||||||
// is_full_iterator_traits --
|
|
||||||
//
|
|
||||||
// A metafunction returning true iff T has all the requisite nested
|
|
||||||
// types to satisfy the requirements for a fully-conforming
|
|
||||||
// iterator_traits implementation.
|
|
||||||
template <class T>
|
|
||||||
struct is_full_iterator_traits_impl
|
|
||||||
{
|
|
||||||
enum { value =
|
|
||||||
has_value_type<T>::value
|
|
||||||
& has_reference<T>::value
|
|
||||||
& has_pointer<T>::value
|
|
||||||
& has_difference_type<T>::value
|
|
||||||
& has_iterator_category<T>::value
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
|
||||||
is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl<T>::value)
|
|
||||||
|
|
||||||
|
|
||||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category)
|
|
||||||
|
|
||||||
// is_stlport_40_debug_iterator --
|
|
||||||
//
|
|
||||||
// A metafunction returning true iff T has all the requisite nested
|
|
||||||
// types to satisfy the requirements of an STLPort 4.0 debug iterator
|
|
||||||
// iterator_traits implementation.
|
|
||||||
template <class T>
|
|
||||||
struct is_stlport_40_debug_iterator_impl
|
|
||||||
{
|
|
||||||
enum { value =
|
|
||||||
has_value_type<T>::value
|
|
||||||
& has_reference<T>::value
|
|
||||||
& has_pointer<T>::value
|
|
||||||
& has_difference_type<T>::value
|
|
||||||
& has__Iterator_category<T>::value
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
|
|
||||||
is_stlport_40_debug_iterator,T,::boost::detail::is_stlport_40_debug_iterator_impl<T>::value)
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct stlport_40_debug_iterator_traits
|
|
||||||
{
|
|
||||||
typedef typename T::value_type value_type;
|
|
||||||
typedef typename T::reference reference;
|
|
||||||
typedef typename T::pointer pointer;
|
|
||||||
typedef typename T::difference_type difference_type;
|
|
||||||
typedef typename T::_Iterator_category iterator_category;
|
|
||||||
};
|
|
||||||
# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
|
|
||||||
template <class T> struct pointer_iterator_traits;
|
|
||||||
|
|
||||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
template <class T>
|
|
||||||
struct pointer_iterator_traits<T*>
|
|
||||||
{
|
|
||||||
typedef typename remove_const<T>::type value_type;
|
|
||||||
typedef T* pointer;
|
|
||||||
typedef T& reference;
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
};
|
|
||||||
# else
|
|
||||||
|
|
||||||
// In case of no template partial specialization, and if T is a
|
|
||||||
// pointer, iterator_traits<T>::value_type can still be computed. For
|
|
||||||
// some basic types, remove_pointer is manually defined in
|
|
||||||
// type_traits/broken_compiler_spec.hpp. For others, do it yourself.
|
|
||||||
|
|
||||||
template<class P> class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee;
|
|
||||||
|
|
||||||
template<class P>
|
|
||||||
struct pointer_value_type
|
|
||||||
: mpl::if_<
|
|
||||||
is_same<P, typename remove_pointer<P>::type>
|
|
||||||
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
|
|
||||||
, typename remove_const<
|
|
||||||
typename remove_pointer<P>::type
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template<class P>
|
|
||||||
struct pointer_reference
|
|
||||||
: mpl::if_<
|
|
||||||
is_same<P, typename remove_pointer<P>::type>
|
|
||||||
, please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
|
|
||||||
, typename remove_pointer<P>::type&
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct pointer_iterator_traits
|
|
||||||
{
|
|
||||||
typedef T pointer;
|
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
|
|
||||||
typedef typename pointer_value_type<T>::type value_type;
|
|
||||||
typedef typename pointer_reference<T>::type reference;
|
|
||||||
};
|
|
||||||
|
|
||||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
// We'll sort iterator types into one of these classifications, from which we
|
|
||||||
// can determine the difference_type, pointer, reference, and value_type
|
|
||||||
template <class Iterator>
|
|
||||||
struct standard_iterator_traits
|
|
||||||
{
|
|
||||||
typedef typename Iterator::difference_type difference_type;
|
|
||||||
typedef typename Iterator::value_type value_type;
|
|
||||||
typedef typename Iterator::pointer pointer;
|
|
||||||
typedef typename Iterator::reference reference;
|
|
||||||
typedef typename Iterator::iterator_category iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
struct msvc_stdlib_mutable_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{
|
|
||||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type* pointer;
|
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type& reference;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
struct msvc_stdlib_const_traits
|
|
||||||
: std::iterator_traits<Iterator>
|
|
||||||
{
|
|
||||||
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
|
|
||||||
typedef const typename std::iterator_traits<Iterator>::value_type* pointer;
|
|
||||||
typedef const typename std::iterator_traits<Iterator>::value_type& reference;
|
|
||||||
};
|
|
||||||
|
|
||||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
|
||||||
template <class Iterator>
|
|
||||||
struct is_bad_output_iterator
|
|
||||||
: is_base_and_derived<
|
|
||||||
std::iterator<std::output_iterator_tag,void,void,void,void>
|
|
||||||
, Iterator>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
struct bad_output_iterator_traits
|
|
||||||
{
|
|
||||||
typedef void value_type;
|
|
||||||
typedef void difference_type;
|
|
||||||
typedef std::output_iterator_tag iterator_category;
|
|
||||||
typedef void pointer;
|
|
||||||
typedef void reference;
|
|
||||||
};
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// If we're looking at an MSVC6 (old Dinkumware) ``standard''
|
|
||||||
// iterator, this will generate an appropriate traits class.
|
|
||||||
template <class Iterator>
|
|
||||||
struct msvc_stdlib_iterator_traits
|
|
||||||
: mpl::if_<
|
|
||||||
is_mutable_iterator<Iterator>
|
|
||||||
, msvc_stdlib_mutable_traits<Iterator>
|
|
||||||
, msvc_stdlib_const_traits<Iterator>
|
|
||||||
>::type
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
struct non_pointer_iterator_traits
|
|
||||||
: mpl::if_<
|
|
||||||
// if the iterator contains all the right nested types...
|
|
||||||
is_full_iterator_traits<Iterator>
|
|
||||||
// Use a standard iterator_traits implementation
|
|
||||||
, standard_iterator_traits<Iterator>
|
|
||||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
// Check for STLPort 4.0 broken _Iterator_category type
|
|
||||||
, mpl::if_<
|
|
||||||
is_stlport_40_debug_iterator<Iterator>
|
|
||||||
, stlport_40_debug_iterator_traits<Iterator>
|
|
||||||
# endif
|
|
||||||
// Otherwise, assume it's a Dinkum iterator
|
|
||||||
, msvc_stdlib_iterator_traits<Iterator>
|
|
||||||
# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
>::type
|
|
||||||
# endif
|
|
||||||
>::type
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
struct iterator_traits_aux
|
|
||||||
: mpl::if_<
|
|
||||||
is_pointer<Iterator>
|
|
||||||
, pointer_iterator_traits<Iterator>
|
|
||||||
, non_pointer_iterator_traits<Iterator>
|
|
||||||
>::type
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
struct iterator_traits
|
|
||||||
{
|
|
||||||
// Explicit forwarding from base class needed to keep MSVC6 happy
|
|
||||||
// under some circumstances.
|
|
||||||
private:
|
|
||||||
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
|
||||||
typedef
|
|
||||||
typename mpl::if_<
|
|
||||||
is_bad_output_iterator<Iterator>
|
|
||||||
, bad_output_iterator_traits
|
|
||||||
, iterator_traits_aux<Iterator>
|
|
||||||
>::type base;
|
|
||||||
# else
|
|
||||||
typedef iterator_traits_aux<Iterator> base;
|
|
||||||
# endif
|
|
||||||
public:
|
|
||||||
typedef typename base::value_type value_type;
|
|
||||||
typedef typename base::pointer pointer;
|
|
||||||
typedef typename base::reference reference;
|
|
||||||
typedef typename base::difference_type difference_type;
|
|
||||||
typedef typename base::iterator_category iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
// This specialization cuts off ETI (Early Template Instantiation) for MSVC.
|
|
||||||
template <> struct iterator_traits<int>
|
|
||||||
{
|
|
||||||
typedef int value_type;
|
|
||||||
typedef int pointer;
|
|
||||||
typedef int reference;
|
|
||||||
typedef int difference_type;
|
|
||||||
typedef int iterator_category;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace boost::detail
|
|
||||||
|
|
||||||
# endif // workarounds
|
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
|
||||||
|
|
||||||
namespace iterator_traits_
|
|
||||||
{
|
|
||||||
template <class Iterator, class Difference>
|
|
||||||
struct distance_select
|
|
||||||
{
|
|
||||||
static Difference execute(Iterator i1, const Iterator i2, ...)
|
|
||||||
{
|
|
||||||
Difference result = 0;
|
|
||||||
while (i1 != i2)
|
|
||||||
{
|
|
||||||
++i1;
|
|
||||||
++result;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Difference execute(Iterator i1, const Iterator i2, std::random_access_iterator_tag*)
|
|
||||||
{
|
|
||||||
return i2 - i1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace boost::detail::iterator_traits_
|
|
||||||
|
|
||||||
template <class Iterator>
|
|
||||||
inline typename iterator_traits<Iterator>::difference_type
|
|
||||||
distance(Iterator first, Iterator last)
|
|
||||||
{
|
|
||||||
typedef typename iterator_traits<Iterator>::difference_type diff_t;
|
|
||||||
typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
|
|
||||||
|
|
||||||
return iterator_traits_::distance_select<Iterator,diff_t>::execute(
|
|
||||||
first, last, (iterator_category*)0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}}
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
|
||||||
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
|
|
||||||
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
|
|
||||||
|
|
||||||
#endif // ITERATOR_DWA122600_HPP_
|
|
36
include/boost/detail/lightweight_main.hpp
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// boost/detail/lightweight_main.hpp -------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright Beman Dawes 2010
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------//
|
||||||
|
// //
|
||||||
|
// exception reporting main() that calls cpp_main() //
|
||||||
|
// //
|
||||||
|
//--------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
int cpp_main(int argc, char* argv[]);
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return cpp_main(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (const std::exception& ex)
|
||||||
|
{
|
||||||
|
std::cout
|
||||||
|
<< "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n"
|
||||||
|
<< "\n****************************** std::exception *****************************\n"
|
||||||
|
<< ex.what()
|
||||||
|
<< "\n***************************************************************************\n"
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
@ -1,75 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// boost/detail/lightweight_test.hpp - lightweight test library
|
|
||||||
//
|
|
||||||
// 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)
|
|
||||||
//
|
|
||||||
// BOOST_TEST(expression)
|
|
||||||
// BOOST_ERROR(message)
|
|
||||||
//
|
|
||||||
// int boost::report_errors()
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <boost/current_function.hpp>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline int & test_errors()
|
|
||||||
{
|
|
||||||
static int x = 0;
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
|
|
||||||
{
|
|
||||||
std::cerr << file << "(" << line << "): test '" << expr << "' failed in function '" << function << "'" << std::endl;
|
|
||||||
++test_errors();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void error_impl(char const * msg, char const * file, int line, char const * function)
|
|
||||||
{
|
|
||||||
std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl;
|
|
||||||
++test_errors();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
inline int report_errors()
|
|
||||||
{
|
|
||||||
int errors = detail::test_errors();
|
|
||||||
|
|
||||||
if(errors == 0)
|
|
||||||
{
|
|
||||||
std::cerr << "No errors detected." << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
|
|
||||||
#define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
|
56
include/boost/detail/lightweight_test_report.hpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// boost/detail/lightweight_test_reporter.hpp ----------------------------------------//
|
||||||
|
|
||||||
|
// Copyright Beman Dawes 2014
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------//
|
||||||
|
// //
|
||||||
|
// Configuration reporting cpp_main() //
|
||||||
|
// //
|
||||||
|
// Displays configuration information, then returns test_main(argc, argv), which //
|
||||||
|
// must be supplied by the user. //
|
||||||
|
// //
|
||||||
|
// Note: cpp_main(argc, argv) is called from a try block in main(), which is //
|
||||||
|
// supplied by <boost/detail/lightweight_main.hpp> as is a catch block that reports //
|
||||||
|
// std::exception what(). //
|
||||||
|
// //
|
||||||
|
//--------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/version.hpp>
|
||||||
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
|
#include <boost/detail/lightweight_main.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int test_main(int argc, char* argv[]);
|
||||||
|
|
||||||
|
int cpp_main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::cout << BOOST_COMPILER
|
||||||
|
#ifdef __GNUC__
|
||||||
|
<< ", __GXX_EXPERIMENTAL_CXX0X__ "
|
||||||
|
# ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
"defined"
|
||||||
|
# else
|
||||||
|
"not defined"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
<< "\n"
|
||||||
|
<< BOOST_STDLIB << "\n"
|
||||||
|
<< BOOST_PLATFORM << "\n"
|
||||||
|
<< "Boost version " << BOOST_VERSION / 100000 << '.'
|
||||||
|
<< BOOST_VERSION / 100 % 1000 << '.' << BOOST_VERSION % 100 << "\n";
|
||||||
|
|
||||||
|
std::cout << "Command line: ";
|
||||||
|
for (int a = 0; a < argc; ++a)
|
||||||
|
{
|
||||||
|
std::cout << argv[a];
|
||||||
|
if (a != argc - 1)
|
||||||
|
std::cout << ' ';
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
return test_main(argc, argv);
|
||||||
|
}
|
@ -1,135 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/detail/lightweight_thread.hpp
|
|
||||||
//
|
|
||||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
|
||||||
// Copyright (c) 2008 Peter Dimov
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <memory>
|
|
||||||
#include <cerrno>
|
|
||||||
|
|
||||||
// pthread_create, pthread_join
|
|
||||||
|
|
||||||
#if defined( BOOST_HAS_PTHREADS )
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <process.h>
|
|
||||||
|
|
||||||
typedef HANDLE pthread_t;
|
|
||||||
|
|
||||||
int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg )
|
|
||||||
{
|
|
||||||
HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
|
|
||||||
|
|
||||||
if( h != 0 )
|
|
||||||
{
|
|
||||||
*thread = h;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return EAGAIN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int pthread_join( pthread_t thread, void ** /*value_ptr*/ )
|
|
||||||
{
|
|
||||||
::WaitForSingleObject( thread, INFINITE );
|
|
||||||
::CloseHandle( thread );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// template<class F> int lw_thread_create( pthread_t & pt, F f );
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
class lw_abstract_thread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
virtual ~lw_abstract_thread() {}
|
|
||||||
virtual void run() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined( BOOST_HAS_PTHREADS )
|
|
||||||
|
|
||||||
extern "C" void * lw_thread_routine( void * pv )
|
|
||||||
{
|
|
||||||
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
|
||||||
|
|
||||||
pt->run();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
unsigned __stdcall lw_thread_routine( void * pv )
|
|
||||||
{
|
|
||||||
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
|
||||||
|
|
||||||
pt->run();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class F> class lw_thread_impl: public lw_abstract_thread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit lw_thread_impl( F f ): f_( f )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void run()
|
|
||||||
{
|
|
||||||
f_();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
F f_;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class F> int lw_thread_create( pthread_t & pt, F f )
|
|
||||||
{
|
|
||||||
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
|
|
||||||
|
|
||||||
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
|
|
||||||
|
|
||||||
if( r == 0 )
|
|
||||||
{
|
|
||||||
p.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
|
|
@ -1,87 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
|
||||||
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
|
||||||
|
|
||||||
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
// (C) Copyright 2004 Pavel Vozenilek.
|
|
||||||
// Use, modification and distribution is subject to the Boost Software
|
|
||||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt
|
|
||||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// This file contains helper macros used when exception support may be
|
|
||||||
// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
|
|
||||||
//
|
|
||||||
// Before picking up these macros you may consider using RAII techniques
|
|
||||||
// to deal with exceptions - their syntax can be always the same with
|
|
||||||
// or without exception support enabled.
|
|
||||||
//
|
|
||||||
|
|
||||||
/* Example of use:
|
|
||||||
|
|
||||||
void foo() {
|
|
||||||
BOOST_TRY {
|
|
||||||
...
|
|
||||||
} BOOST_CATCH(const std::bad_alloc&) {
|
|
||||||
...
|
|
||||||
BOOST_RETHROW
|
|
||||||
} BOOST_CATCH(const std::exception& e) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
BOOST_CATCH_END
|
|
||||||
}
|
|
||||||
|
|
||||||
With exception support enabled it will expand into:
|
|
||||||
|
|
||||||
void foo() {
|
|
||||||
{ try {
|
|
||||||
...
|
|
||||||
} catch (const std::bad_alloc&) {
|
|
||||||
...
|
|
||||||
throw;
|
|
||||||
} catch (const std::exception& e) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
With exception support disabled it will expand into:
|
|
||||||
|
|
||||||
void foo() {
|
|
||||||
{ if(true) {
|
|
||||||
...
|
|
||||||
} else if (false) {
|
|
||||||
...
|
|
||||||
} else if (false) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/detail/workaround.hpp>
|
|
||||||
|
|
||||||
#if !(defined BOOST_NO_EXCEPTIONS)
|
|
||||||
# define BOOST_TRY { try
|
|
||||||
# define BOOST_CATCH(x) catch(x)
|
|
||||||
# define BOOST_RETHROW throw;
|
|
||||||
# define BOOST_CATCH_END }
|
|
||||||
#else
|
|
||||||
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
||||||
# define BOOST_TRY { if ("")
|
|
||||||
# define BOOST_CATCH(x) else if (!"")
|
|
||||||
# else
|
|
||||||
# define BOOST_TRY { if (true)
|
|
||||||
# define BOOST_CATCH(x) else if (false)
|
|
||||||
# endif
|
|
||||||
# define BOOST_RETHROW
|
|
||||||
# define BOOST_CATCH_END }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -74,7 +74,7 @@ namespace boost { namespace detail {
|
|||||||
template <class Number>
|
template <class Number>
|
||||||
struct is_signed
|
struct is_signed
|
||||||
{
|
{
|
||||||
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
|
||||||
BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
|
BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
|
||||||
#else
|
#else
|
||||||
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
|
BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
|
||||||
@ -128,15 +128,6 @@ namespace boost { namespace detail {
|
|||||||
private:
|
private:
|
||||||
typedef Integer integer_type;
|
typedef Integer integer_type;
|
||||||
typedef std::numeric_limits<integer_type> x;
|
typedef std::numeric_limits<integer_type> x;
|
||||||
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
|
||||||
// for some reason, MSVC asserts when it shouldn't unless we make these
|
|
||||||
// local definitions
|
|
||||||
BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);
|
|
||||||
BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized);
|
|
||||||
|
|
||||||
BOOST_STATIC_ASSERT(is_integer);
|
|
||||||
BOOST_STATIC_ASSERT(is_specialized);
|
|
||||||
# endif
|
|
||||||
public:
|
public:
|
||||||
typedef typename
|
typedef typename
|
||||||
if_true<(int(x::is_signed)
|
if_true<(int(x::is_signed)
|
||||||
|
@ -1,198 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// detail/quick_allocator.hpp
|
|
||||||
//
|
|
||||||
// Copyright (c) 2003 David Abrahams
|
|
||||||
// Copyright (c) 2003 Peter Dimov
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
#include <boost/detail/lightweight_mutex.hpp>
|
|
||||||
#include <boost/type_traits/type_with_alignment.hpp>
|
|
||||||
#include <boost/type_traits/alignment_of.hpp>
|
|
||||||
|
|
||||||
#include <new> // ::operator new, ::operator delete
|
|
||||||
#include <cstddef> // std::size_t
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_> union freeblock
|
|
||||||
{
|
|
||||||
typedef typename boost::type_with_alignment<align_>::type aligner_type;
|
|
||||||
aligner_type aligner;
|
|
||||||
char bytes[size];
|
|
||||||
freeblock * next;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_> struct allocator_impl
|
|
||||||
{
|
|
||||||
typedef freeblock<size, align_> block;
|
|
||||||
|
|
||||||
// It may seem odd to use such small pages.
|
|
||||||
//
|
|
||||||
// However, on a typical Windows implementation that uses
|
|
||||||
// the OS allocator, "normal size" pages interact with the
|
|
||||||
// "ordinary" operator new, slowing it down dramatically.
|
|
||||||
//
|
|
||||||
// 512 byte pages are handled by the small object allocator,
|
|
||||||
// and don't interfere with ::new.
|
|
||||||
//
|
|
||||||
// The other alternative is to use much bigger pages (1M.)
|
|
||||||
//
|
|
||||||
// It is surprisingly easy to hit pathological behavior by
|
|
||||||
// varying the page size. g++ 2.96 on Red Hat Linux 7.2,
|
|
||||||
// for example, passionately dislikes 496. 512 seems OK.
|
|
||||||
|
|
||||||
#if defined(BOOST_QA_PAGE_SIZE)
|
|
||||||
|
|
||||||
enum { items_per_page = BOOST_QA_PAGE_SIZE / size };
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
enum { items_per_page = 512 / size }; // 1048560 / size
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
|
|
||||||
static lightweight_mutex & mutex()
|
|
||||||
{
|
|
||||||
static lightweight_mutex m;
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
static lightweight_mutex * mutex_init;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static block * free;
|
|
||||||
static block * page;
|
|
||||||
static unsigned last;
|
|
||||||
|
|
||||||
static inline void * alloc()
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
if(block * x = free)
|
|
||||||
{
|
|
||||||
free = x->next;
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(last == items_per_page)
|
|
||||||
{
|
|
||||||
// "Listen to me carefully: there is no memory leak"
|
|
||||||
// -- Scott Meyers, Eff C++ 2nd Ed Item 10
|
|
||||||
page = ::new block[items_per_page];
|
|
||||||
last = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &page[last++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void * alloc(std::size_t n)
|
|
||||||
{
|
|
||||||
if(n != size) // class-specific new called for a derived object
|
|
||||||
{
|
|
||||||
return ::operator new(n);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
if(block * x = free)
|
|
||||||
{
|
|
||||||
free = x->next;
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(last == items_per_page)
|
|
||||||
{
|
|
||||||
page = ::new block[items_per_page];
|
|
||||||
last = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &page[last++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void dealloc(void * pv)
|
|
||||||
{
|
|
||||||
if(pv != 0) // 18.4.1.1/13
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
block * pb = static_cast<block *>(pv);
|
|
||||||
pb->next = free;
|
|
||||||
free = pb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void dealloc(void * pv, std::size_t n)
|
|
||||||
{
|
|
||||||
if(n != size) // class-specific delete called for a derived object
|
|
||||||
{
|
|
||||||
::operator delete(pv);
|
|
||||||
}
|
|
||||||
else if(pv != 0) // 18.4.1.1/13
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
lightweight_mutex::scoped_lock lock( mutex() );
|
|
||||||
#endif
|
|
||||||
block * pb = static_cast<block *>(pv);
|
|
||||||
pb->next = free;
|
|
||||||
free = pb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
lightweight_mutex * allocator_impl<size, align_>::mutex_init = &allocator_impl<size, align_>::mutex();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
freeblock<size, align_> * allocator_impl<size, align_>::free = 0;
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
freeblock<size, align_> * allocator_impl<size, align_>::page = 0;
|
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
|
||||||
unsigned allocator_impl<size, align_>::last = allocator_impl<size, align_>::items_per_page;
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of<T>::value >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED
|
|
@ -15,13 +15,8 @@
|
|||||||
|
|
||||||
#include "boost/config.hpp"
|
#include "boost/config.hpp"
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
# include "boost/mpl/bool.hpp"
|
# include "boost/mpl/bool.hpp"
|
||||||
# include "boost/type_traits/has_nothrow_copy.hpp"
|
# include "boost/type_traits/has_nothrow_copy.hpp"
|
||||||
#else
|
|
||||||
# include "boost/mpl/if.hpp"
|
|
||||||
# include "boost/type_traits/is_reference.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "boost/mpl/void.hpp"
|
#include "boost/mpl/void.hpp"
|
||||||
|
|
||||||
@ -78,7 +73,6 @@ public: // queries
|
|||||||
|
|
||||||
template <typename T = mpl::void_> struct make_reference_content;
|
template <typename T = mpl::void_> struct make_reference_content;
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct make_reference_content
|
struct make_reference_content
|
||||||
@ -92,19 +86,6 @@ struct make_reference_content< T& >
|
|||||||
typedef reference_content<T&> type;
|
typedef reference_content<T&> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct make_reference_content
|
|
||||||
: mpl::if_<
|
|
||||||
is_reference<T>
|
|
||||||
, reference_content<T>
|
|
||||||
, T
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct make_reference_content< mpl::void_ >
|
struct make_reference_content< mpl::void_ >
|
||||||
@ -124,7 +105,6 @@ struct make_reference_content< mpl::void_ >
|
|||||||
// reference_content<T&> type traits specializations
|
// reference_content<T&> type traits specializations
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct has_nothrow_copy<
|
struct has_nothrow_copy<
|
||||||
@ -134,7 +114,6 @@ struct has_nothrow_copy<
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||||
// utf8_codecvt_facet.hpp
|
// utf8_codecvt_facet.hpp
|
||||||
|
|
||||||
// This header defines class utf8_codecvt_facet, derived fro
|
// This header defines class utf8_codecvt_facet, derived from
|
||||||
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
|
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
|
||||||
// files into wchar_t strings in the application.
|
// files into wchar_t strings in the application.
|
||||||
//
|
//
|
||||||
@ -28,12 +28,13 @@
|
|||||||
// This seems inconvenient, and asking a user to link to an unrevieved
|
// This seems inconvenient, and asking a user to link to an unrevieved
|
||||||
// library is strange.
|
// library is strange.
|
||||||
// Until the above points are fixed, a library which wants to use utf8 must:
|
// Until the above points are fixed, a library which wants to use utf8 must:
|
||||||
// - include this header from one of it's headers or sources
|
// - include this header in one of it's headers or sources
|
||||||
// - include the corresponding .cpp file from one of the sources
|
// - include the corresponding boost/detail/utf8_codecvt_facet.ipp file in one
|
||||||
|
// of its sources
|
||||||
// - before including either file, the library must define
|
// - before including either file, the library must define
|
||||||
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
|
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
|
||||||
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
|
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
|
||||||
// - declaration.
|
// declaration.
|
||||||
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
|
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
|
||||||
// symbols.
|
// symbols.
|
||||||
//
|
//
|
||||||
@ -42,7 +43,7 @@
|
|||||||
// namespace boost { namespace program_options {
|
// namespace boost { namespace program_options {
|
||||||
// #define BOOST_UTF8_END_NAMESPACE }}
|
// #define BOOST_UTF8_END_NAMESPACE }}
|
||||||
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
|
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
|
||||||
// #include "../../detail/utf8/utf8_codecvt.cpp"
|
// #include <boost/detail/utf8_codecvt_facet.ipp>
|
||||||
//
|
//
|
||||||
// Essentially, each library will have its own copy of utf8 code, in
|
// Essentially, each library will have its own copy of utf8 code, in
|
||||||
// different namespaces.
|
// different namespaces.
|
||||||
@ -79,21 +80,17 @@
|
|||||||
// specialized on those types for this to work.
|
// specialized on those types for this to work.
|
||||||
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <cwchar> // for mbstate_t
|
#include <cwchar> // for mbstate_t
|
||||||
#include <cstddef> // for std::size_t
|
#include <cstddef> // for std::size_t
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
using ::codecvt;
|
namespace std {
|
||||||
using ::mbstate_t;
|
using ::mbstate_t;
|
||||||
#endif
|
using ::size_t;
|
||||||
|
}
|
||||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
|
||||||
#else
|
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// maximum lenght of a multibyte string
|
// maximum lenght of a multibyte string
|
||||||
@ -101,15 +98,25 @@
|
|||||||
|
|
||||||
BOOST_UTF8_BEGIN_NAMESPACE
|
BOOST_UTF8_BEGIN_NAMESPACE
|
||||||
|
|
||||||
struct BOOST_UTF8_DECL utf8_codecvt_facet :
|
//----------------------------------------------------------------------------//
|
||||||
|
// //
|
||||||
|
// utf8_codecvt_facet //
|
||||||
|
// //
|
||||||
|
// See utf8_codecvt_facet.ipp for the implementation. //
|
||||||
|
//----------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
#ifndef BOOST_UTF8_DECL
|
||||||
|
#define BOOST_UTF8_DECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct BOOST_SYMBOL_VISIBLE utf8_codecvt_facet :
|
||||||
public std::codecvt<wchar_t, char, std::mbstate_t>
|
public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit utf8_codecvt_facet(std::size_t no_locale_manage=0)
|
BOOST_UTF8_DECL explicit utf8_codecvt_facet(std::size_t no_locale_manage=0);
|
||||||
: std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
virtual ~utf8_codecvt_facet(){}
|
||||||
{}
|
|
||||||
protected:
|
protected:
|
||||||
virtual std::codecvt_base::result do_in(
|
BOOST_UTF8_DECL virtual std::codecvt_base::result do_in(
|
||||||
std::mbstate_t& state,
|
std::mbstate_t& state,
|
||||||
const char * from,
|
const char * from,
|
||||||
const char * from_end,
|
const char * from_end,
|
||||||
@ -119,10 +126,14 @@ protected:
|
|||||||
wchar_t*& to_next
|
wchar_t*& to_next
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
virtual std::codecvt_base::result do_out(
|
BOOST_UTF8_DECL virtual std::codecvt_base::result do_out(
|
||||||
std::mbstate_t & state, const wchar_t * from,
|
std::mbstate_t & state,
|
||||||
const wchar_t * from_end, const wchar_t* & from_next,
|
const wchar_t * from,
|
||||||
char * to, char * to_end, char * & to_next
|
const wchar_t * from_end,
|
||||||
|
const wchar_t* & from_next,
|
||||||
|
char * to,
|
||||||
|
char * to_end,
|
||||||
|
char * & to_next
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
bool invalid_continuing_octet(unsigned char octet_1) const {
|
bool invalid_continuing_octet(unsigned char octet_1) const {
|
||||||
@ -135,17 +146,19 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// continuing octets = octets except for the leading octet
|
// continuing octets = octets except for the leading octet
|
||||||
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
|
static unsigned int get_cont_octet_count(unsigned char lead_octet) {
|
||||||
return get_octet_count(lead_octet) - 1;
|
return get_octet_count(lead_octet) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int get_octet_count(unsigned char lead_octet);
|
BOOST_UTF8_DECL static unsigned int get_octet_count(unsigned char lead_octet);
|
||||||
|
|
||||||
// How many "continuing octets" will be needed for this word
|
// How many "continuing octets" will be needed for this word
|
||||||
// == total octets - 1.
|
// == total octets - 1.
|
||||||
int get_cont_octet_out_count(wchar_t word) const ;
|
BOOST_UTF8_DECL int get_cont_octet_out_count(wchar_t word) const ;
|
||||||
|
|
||||||
virtual bool do_always_noconv() const throw() { return false; }
|
virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// UTF-8 isn't really stateful since we rewind on partial conversions
|
// UTF-8 isn't really stateful since we rewind on partial conversions
|
||||||
virtual std::codecvt_base::result do_unshift(
|
virtual std::codecvt_base::result do_unshift(
|
||||||
@ -153,32 +166,47 @@ protected:
|
|||||||
char * from,
|
char * from,
|
||||||
char * /*to*/,
|
char * /*to*/,
|
||||||
char * & next
|
char * & next
|
||||||
) const
|
) const {
|
||||||
{
|
|
||||||
next = from;
|
next = from;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int do_encoding() const throw() {
|
virtual int do_encoding() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||||
const int variable_byte_external_encoding=0;
|
const int variable_byte_external_encoding=0;
|
||||||
return variable_byte_external_encoding;
|
return variable_byte_external_encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
// How many char objects can I process to get <= max_limit
|
// How many char objects can I process to get <= max_limit
|
||||||
// wchar_t objects?
|
// wchar_t objects?
|
||||||
virtual int do_length(
|
BOOST_UTF8_DECL virtual int do_length(
|
||||||
BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
|
const std::mbstate_t &,
|
||||||
const char * from,
|
const char * from,
|
||||||
const char * from_end,
|
const char * from_end,
|
||||||
std::size_t max_limit
|
std::size_t max_limit
|
||||||
|
) const
|
||||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||||
) const throw();
|
throw()
|
||||||
#else
|
|
||||||
) const;
|
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
|
virtual int do_length(
|
||||||
|
std::mbstate_t & s,
|
||||||
|
const char * from,
|
||||||
|
const char * from_end,
|
||||||
|
std::size_t max_limit
|
||||||
|
) const
|
||||||
|
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||||
|
throw()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return do_length(
|
||||||
|
const_cast<const std::mbstate_t &>(s),
|
||||||
|
from,
|
||||||
|
from_end,
|
||||||
|
max_limit
|
||||||
|
);
|
||||||
|
}
|
||||||
// Largest possible value do_length(state,from,from_end,1) could return.
|
// Largest possible value do_length(state,from,from_end,1) could return.
|
||||||
virtual int do_max_length() const throw () {
|
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||||
return 6; // largest UTF-8 encoding of a UCS-4 character
|
return 6; // largest UTF-8 encoding of a UCS-4 character
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||||
// utf8_codecvt_facet.cpp
|
// utf8_codecvt_facet.ipp
|
||||||
|
|
||||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
||||||
@ -30,8 +30,14 @@ BOOST_UTF8_BEGIN_NAMESPACE
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||||
// implementation for wchar_t
|
// implementation for wchar_t
|
||||||
|
|
||||||
|
BOOST_UTF8_DECL utf8_codecvt_facet::utf8_codecvt_facet(
|
||||||
|
std::size_t no_locale_manage
|
||||||
|
) :
|
||||||
|
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
||||||
|
{}
|
||||||
|
|
||||||
// Translate incoming UTF-8 into UCS-4
|
// Translate incoming UTF-8 into UCS-4
|
||||||
std::codecvt_base::result utf8_codecvt_facet::do_in(
|
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_in(
|
||||||
std::mbstate_t& /*state*/,
|
std::mbstate_t& /*state*/,
|
||||||
const char * from,
|
const char * from,
|
||||||
const char * from_end,
|
const char * from_end,
|
||||||
@ -108,7 +114,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_in(
|
|||||||
else return std::codecvt_base::partial;
|
else return std::codecvt_base::partial;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::codecvt_base::result utf8_codecvt_facet::do_out(
|
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||||
std::mbstate_t& /*state*/,
|
std::mbstate_t& /*state*/,
|
||||||
const wchar_t * from,
|
const wchar_t * from,
|
||||||
const wchar_t * from_end,
|
const wchar_t * from_end,
|
||||||
@ -159,7 +165,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
|||||||
to_next = to - (i+1);
|
to_next = to - (i+1);
|
||||||
return std::codecvt_base::partial;
|
return std::codecvt_base::partial;
|
||||||
}
|
}
|
||||||
*from++;
|
++from;
|
||||||
}
|
}
|
||||||
from_next = from;
|
from_next = from;
|
||||||
to_next = to;
|
to_next = to;
|
||||||
@ -170,15 +176,14 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
|||||||
|
|
||||||
// How many char objects can I process to get <= max_limit
|
// How many char objects can I process to get <= max_limit
|
||||||
// wchar_t objects?
|
// wchar_t objects?
|
||||||
int utf8_codecvt_facet::do_length(
|
BOOST_UTF8_DECL int utf8_codecvt_facet::do_length(
|
||||||
BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
|
const std::mbstate_t &,
|
||||||
const char * from,
|
const char * from,
|
||||||
const char * from_end,
|
const char * from_end,
|
||||||
std::size_t max_limit
|
std::size_t max_limit
|
||||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
|
||||||
) const throw()
|
|
||||||
#else
|
|
||||||
) const
|
) const
|
||||||
|
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||||
|
throw()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// RG - this code is confusing! I need a better way to express it.
|
// RG - this code is confusing! I need a better way to express it.
|
||||||
@ -199,10 +204,10 @@ int utf8_codecvt_facet::do_length(
|
|||||||
last_octet_count = (get_octet_count(*from_next));
|
last_octet_count = (get_octet_count(*from_next));
|
||||||
++char_count;
|
++char_count;
|
||||||
}
|
}
|
||||||
return static_cast<int>(from_next-from_end);
|
return static_cast<int>(from_next-from);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int utf8_codecvt_facet::get_octet_count(
|
BOOST_UTF8_DECL unsigned int utf8_codecvt_facet::get_octet_count(
|
||||||
unsigned char lead_octet
|
unsigned char lead_octet
|
||||||
){
|
){
|
||||||
// if the 0-bit (MSB) is 0, then 1 character
|
// if the 0-bit (MSB) is 0, then 1 character
|
||||||
@ -217,9 +222,9 @@ unsigned int utf8_codecvt_facet::get_octet_count(
|
|||||||
else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
|
else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
|
||||||
else return 6;
|
else return 6;
|
||||||
}
|
}
|
||||||
BOOST_UTF8_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace {
|
namespace detail {
|
||||||
|
|
||||||
template<std::size_t s>
|
template<std::size_t s>
|
||||||
int get_cont_octet_out_count_impl(wchar_t word){
|
int get_cont_octet_out_count_impl(wchar_t word){
|
||||||
if (word < 0x80) {
|
if (word < 0x80) {
|
||||||
@ -231,9 +236,6 @@ int get_cont_octet_out_count_impl(wchar_t word){
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note the following code will generate on some platforms where
|
|
||||||
// wchar_t is defined as UCS2. The warnings are superfluous as
|
|
||||||
// the specialization is never instantitiated with such compilers.
|
|
||||||
template<>
|
template<>
|
||||||
int get_cont_octet_out_count_impl<4>(wchar_t word){
|
int get_cont_octet_out_count_impl<4>(wchar_t word){
|
||||||
if (word < 0x80) {
|
if (word < 0x80) {
|
||||||
@ -242,7 +244,22 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
|
|||||||
if (word < 0x800) {
|
if (word < 0x800) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (word < 0x10000) {
|
|
||||||
|
// Note that the following code will generate warnings on some platforms
|
||||||
|
// where wchar_t is defined as UCS2. The warnings are superfluous as the
|
||||||
|
// specialization is never instantitiated with such compilers, but this
|
||||||
|
// can cause problems if warnings are being treated as errors, so we guard
|
||||||
|
// against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
|
||||||
|
// should be enough to get WCHAR_MAX defined.
|
||||||
|
#if !defined(WCHAR_MAX)
|
||||||
|
# error WCHAR_MAX not defined!
|
||||||
|
#endif
|
||||||
|
// cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
|
||||||
|
return 2;
|
||||||
|
#elif WCHAR_MAX > 0x10000
|
||||||
|
|
||||||
|
if (word < 0x10000) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
if (word < 0x200000) {
|
if (word < 0x200000) {
|
||||||
@ -252,17 +269,20 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
return 5;
|
return 5;
|
||||||
|
|
||||||
|
#else
|
||||||
|
return 2;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace anonymous
|
} // namespace detail
|
||||||
|
|
||||||
BOOST_UTF8_BEGIN_NAMESPACE
|
|
||||||
// How many "continuing octets" will be needed for this word
|
// How many "continuing octets" will be needed for this word
|
||||||
// == total octets - 1.
|
// == total octets - 1.
|
||||||
int utf8_codecvt_facet::get_cont_octet_out_count(
|
BOOST_UTF8_DECL int utf8_codecvt_facet::get_cont_octet_out_count(
|
||||||
wchar_t word
|
wchar_t word
|
||||||
) const {
|
) const {
|
||||||
return get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
|
return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
|
||||||
}
|
}
|
||||||
BOOST_UTF8_END_NAMESPACE
|
BOOST_UTF8_END_NAMESPACE
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
|
|
||||||
# define INDIRECT_REFERENCE_DWA200415_HPP
|
|
||||||
|
|
||||||
//
|
|
||||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
|
||||||
// subject to the Boost Software License, Version 1.0. (See accompanying
|
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
//
|
|
||||||
// typename indirect_reference<P>::type provides the type of *p.
|
|
||||||
//
|
|
||||||
// http://www.boost.org/libs/iterator/doc/pointee.html
|
|
||||||
//
|
|
||||||
|
|
||||||
# include <boost/detail/is_incrementable.hpp>
|
|
||||||
# include <boost/iterator/iterator_traits.hpp>
|
|
||||||
# include <boost/type_traits/remove_cv.hpp>
|
|
||||||
# include <boost/mpl/eval_if.hpp>
|
|
||||||
# include <boost/pointee.hpp>
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
template <class P>
|
|
||||||
struct smart_ptr_reference
|
|
||||||
{
|
|
||||||
typedef typename boost::pointee<P>::type& type;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class P>
|
|
||||||
struct indirect_reference
|
|
||||||
: mpl::eval_if<
|
|
||||||
detail::is_incrementable<P>
|
|
||||||
, iterator_reference<P>
|
|
||||||
, detail::smart_ptr_reference<P>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // INDIRECT_REFERENCE_DWA200415_HPP
|
|
@ -1,27 +0,0 @@
|
|||||||
// -------------------------------------
|
|
||||||
//
|
|
||||||
// (C) Copyright Gennaro Prota 2003.
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
|
||||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
//
|
|
||||||
// ------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef BOOST_NON_TYPE_HPP_GP_20030417
|
|
||||||
#define BOOST_NON_TYPE_HPP_GP_20030417
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
// Just a simple "envelope" for non-type template parameters. Useful
|
|
||||||
// to work around some MSVC deficiencies.
|
|
||||||
|
|
||||||
template <typename T, T n>
|
|
||||||
struct non_type { };
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // include guard
|
|
@ -1,16 +0,0 @@
|
|||||||
// -*- C++ -*- forwarding header.
|
|
||||||
// (C) Copyright Jeremy Siek 2004
|
|
||||||
// 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)
|
|
||||||
|
|
||||||
#ifndef BOOST_CSTDDEF_HPP
|
|
||||||
#define BOOST_CSTDDEF_HPP
|
|
||||||
|
|
||||||
#if defined(__sgi) && !defined(__GNUC__)
|
|
||||||
# include <stddef.h>
|
|
||||||
#else
|
|
||||||
# include <cstddef>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,43 +0,0 @@
|
|||||||
// (C) Copyright Jeremy Siek 2000.
|
|
||||||
// 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)
|
|
||||||
|
|
||||||
// This header replaces the implementation of ct_if that preceded the
|
|
||||||
// introduction of Boost.MPL with a facade that defers to that reviewed and
|
|
||||||
// accepted library.
|
|
||||||
|
|
||||||
// Author: Ronald Garcia
|
|
||||||
// Date: 20 October, 2006
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_CT_IF_HPP
|
|
||||||
#define BOOST_CT_IF_HPP
|
|
||||||
|
|
||||||
|
|
||||||
// A stub implementation in terms of Boost.MPL
|
|
||||||
|
|
||||||
#include <boost/mpl/if.hpp>
|
|
||||||
#include <boost/mpl/not.hpp>
|
|
||||||
#include <boost/mpl/and.hpp>
|
|
||||||
// true_type and false_type are used by applications of ct_if
|
|
||||||
#include <boost/type_traits/integral_constant.hpp>
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
template <class A, class B>
|
|
||||||
struct ct_and : boost::mpl::and_<A,B> {};
|
|
||||||
|
|
||||||
template <class A>
|
|
||||||
struct ct_not : mpl::not_<A> {};
|
|
||||||
|
|
||||||
template <bool cond, class A, class B>
|
|
||||||
struct ct_if : mpl::if_c<cond,A,B> {};
|
|
||||||
|
|
||||||
template <class cond, class A, class B>
|
|
||||||
struct ct_if_t : mpl::if_<cond,A,B> {};
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_CT_IF_HPP
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
|||||||
// -------------------------------------
|
|
||||||
// integer_log2.hpp
|
|
||||||
//
|
|
||||||
// Gives the integer part of the logarithm, in base 2, of a
|
|
||||||
// given number. Behavior is undefined if the argument is <= 0.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// (C) Copyright Gennaro Prota 2003 - 2004.
|
|
||||||
//
|
|
||||||
// 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)
|
|
||||||
//
|
|
||||||
// ------------------------------------------------------
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
|
||||||
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
#include <climits>
|
|
||||||
#endif
|
|
||||||
#include "boost/limits.hpp"
|
|
||||||
#include "boost/config.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
int integer_log2_impl(T x, int n) {
|
|
||||||
|
|
||||||
int result = 0;
|
|
||||||
|
|
||||||
while (x != 1) {
|
|
||||||
|
|
||||||
const T t = x >> n;
|
|
||||||
if (t) {
|
|
||||||
result += n;
|
|
||||||
x = t;
|
|
||||||
}
|
|
||||||
n /= 2;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// helper to find the maximum power of two
|
|
||||||
// less than p (more involved than necessary,
|
|
||||||
// to avoid PTS)
|
|
||||||
//
|
|
||||||
template <int p, int n>
|
|
||||||
struct max_pow2_less {
|
|
||||||
|
|
||||||
enum { c = 2*n < p };
|
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(int, value =
|
|
||||||
c ? (max_pow2_less< c*p, 2*c*n>::value) : n);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct max_pow2_less<0, 0> {
|
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
// this template is here just for Borland :(
|
|
||||||
// we could simply rely on numeric_limits but sometimes
|
|
||||||
// Borland tries to use numeric_limits<const T>, because
|
|
||||||
// of its usual const-related problems in argument deduction
|
|
||||||
// - gps
|
|
||||||
template <typename T>
|
|
||||||
struct width {
|
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
BOOST_STATIC_CONSTANT(int, value = sizeof(T) * CHAR_BIT);
|
|
||||||
#else
|
|
||||||
BOOST_STATIC_CONSTANT(int, value = (std::numeric_limits<T>::digits));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // detail
|
|
||||||
|
|
||||||
|
|
||||||
// ---------
|
|
||||||
// integer_log2
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
template <typename T>
|
|
||||||
int integer_log2(T x) {
|
|
||||||
|
|
||||||
assert(x > 0);
|
|
||||||
|
|
||||||
const int n = detail::max_pow2_less<
|
|
||||||
detail::width<T> :: value, 4
|
|
||||||
> :: value;
|
|
||||||
|
|
||||||
return detail::integer_log2_impl(x, n);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // include guard
|
|
@ -1,18 +0,0 @@
|
|||||||
// (C) Copyright David Abrahams 2001.
|
|
||||||
// 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)
|
|
||||||
|
|
||||||
#ifndef BOOST_TYPE_DWA20010120_HPP
|
|
||||||
# define BOOST_TYPE_DWA20010120_HPP
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
// Just a simple "type envelope". Useful in various contexts, mostly to work
|
|
||||||
// around some MSVC deficiencies.
|
|
||||||
template <class T>
|
|
||||||
struct type {};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_TYPE_DWA20010120_HPP
|
|
@ -1,29 +0,0 @@
|
|||||||
// Boost.Signals library
|
|
||||||
|
|
||||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
|
||||||
// distribution is subject to the Boost Software License, Version
|
|
||||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// For more information, see http://www.boost.org/libs/signals
|
|
||||||
|
|
||||||
#ifndef BOOST_VISIT_EACH_HPP
|
|
||||||
#define BOOST_VISIT_EACH_HPP
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
template<typename Visitor, typename T>
|
|
||||||
inline void visit_each(Visitor& visitor, const T& t, long)
|
|
||||||
{
|
|
||||||
visitor(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Visitor, typename T>
|
|
||||||
inline void visit_each(Visitor& visitor, const T& t)
|
|
||||||
{
|
|
||||||
visit_each(visitor, t, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_VISIT_EACH_HPP
|
|
14
index.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!--
|
||||||
|
Copyright 2016 Rene Rivera
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See the accompanying
|
||||||
|
file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Automatic redirection failed, please go to
|
||||||
|
<a href="./doc/html/index.html">./doc/html/index.html</a>.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
27
meta/libraries.json
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"key": "detail",
|
||||||
|
"name": "Detail",
|
||||||
|
"status": "hidden",
|
||||||
|
"authors": [
|
||||||
|
"David Abrahams",
|
||||||
|
"Beman Dawes",
|
||||||
|
"Eric Friedman",
|
||||||
|
"Ronald Garcia",
|
||||||
|
"Howard Hinnant",
|
||||||
|
"Daniel James",
|
||||||
|
"Bryce Lelbach",
|
||||||
|
"Joaquin M Lopez Munoz",
|
||||||
|
"Jeremy Siek",
|
||||||
|
"Matthias Troyerk"
|
||||||
|
],
|
||||||
|
"description": "This library contains a set of header only utilities used internally by Boost C++ Libraries to facilitate their implementation.",
|
||||||
|
"category": [
|
||||||
|
"Miscellaneous"
|
||||||
|
],
|
||||||
|
"maintainers": [
|
||||||
|
"Beman Dawes <bdawes -at- acm.org>",
|
||||||
|
"Robert Ramey <ramey -at- rrsd.com>",
|
||||||
|
"Rene Rivera <grafikrobot -at- gmail.com>",
|
||||||
|
"Andrey Semashev <andrey.semashev -at- gmail.com>"
|
||||||
|
]
|
||||||
|
}
|
28
test/Jamfile
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
################################################################*# Jam #*#######
|
||||||
|
# Copyright (C) 2010 Bryce Lelbach
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
build-project container_fwd ;
|
||||||
|
|
||||||
|
project detail/test
|
||||||
|
: requirements
|
||||||
|
<toolset>clang:<cxxflags>-Wno-unused
|
||||||
|
<toolset>clang:<cxxflags>-Wno-tautological-compare
|
||||||
|
<toolset>clang:<cxxflags>-ftemplate-depth-300
|
||||||
|
<toolset>gcc:<cxxflags>-ftemplate-depth-300
|
||||||
|
<toolset>gcc:<define>_STLP_DEBUG
|
||||||
|
<toolset>gcc:<define>_GLIBCXX_DEBUG
|
||||||
|
<toolset>darwin:<cxxflags>-ftemplate-depth-300
|
||||||
|
;
|
||||||
|
|
||||||
|
# import rules for testing conditional on config file variables
|
||||||
|
import ../../config/checks/config : requires ;
|
||||||
|
|
||||||
|
run binary_search_test.cpp ;
|
||||||
|
run is_sorted_test.cpp ;
|
||||||
|
run test_utf8_codecvt.cpp : :
|
||||||
|
: [ requires std_wstreambuf ]
|
||||||
|
;
|
260
test/binary_search_test.cpp
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
// (C) Copyright David Abrahams 2000.
|
||||||
|
// 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 <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <climits>
|
||||||
|
#include <iostream>
|
||||||
|
#include <cassert>
|
||||||
|
#include <stdlib.h> // for rand(). Would use cstdlib but VC6.4 doesn't put it in std::
|
||||||
|
#include <list>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <boost/detail/binary_search.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
#if defined(__SGI_STL_PORT) ? defined(__SGI_STL_OWN_IOSTREAMS) : (!defined(__GNUC__) || __GNUC__ > 2)
|
||||||
|
# define USE_SSTREAM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_SSTREAM
|
||||||
|
# include <sstream>
|
||||||
|
#else
|
||||||
|
# include <strstream>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// In order to get ADL to find the comparison operators defined below, they have
|
||||||
|
struct mystring : std::string
|
||||||
|
{
|
||||||
|
typedef std::string base;
|
||||||
|
|
||||||
|
mystring(std::string const& x)
|
||||||
|
: base(x) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::vector<mystring> string_vector;
|
||||||
|
|
||||||
|
const std::size_t sequence_length = 1000;
|
||||||
|
|
||||||
|
unsigned random_number()
|
||||||
|
{
|
||||||
|
return static_cast<unsigned>(::rand()) % sequence_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifndef USE_SSTREAM
|
||||||
|
class unfreezer {
|
||||||
|
public:
|
||||||
|
unfreezer(std::ostrstream& s) : m_stream(s) {}
|
||||||
|
~unfreezer() { m_stream.freeze(false); }
|
||||||
|
private:
|
||||||
|
std::ostrstream& m_stream;
|
||||||
|
};
|
||||||
|
# endif
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void push_back_random_number_string(T& seq)
|
||||||
|
{
|
||||||
|
unsigned value = random_number();
|
||||||
|
# if defined(__SGI_STL_PORT) ? defined(__SGI_STL_OWN_IOSTREAMS) : (!defined(__GNUC__) || __GNUC__ > 2)
|
||||||
|
std::ostringstream s;
|
||||||
|
s << value;
|
||||||
|
seq.push_back(s.str());
|
||||||
|
# else
|
||||||
|
std::ostrstream s;
|
||||||
|
auto unfreezer unfreeze(s);
|
||||||
|
s << value << char(0);
|
||||||
|
seq.push_back(std::string(s.str()));
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned to_int(unsigned x) { return x; }
|
||||||
|
inline unsigned to_int(const std::string& x) { return atoi(x.c_str()); }
|
||||||
|
|
||||||
|
struct cmp
|
||||||
|
{
|
||||||
|
template <class A1, class A2>
|
||||||
|
inline bool operator()(const A1& a1, const A2& a2) const
|
||||||
|
{
|
||||||
|
return to_int(a1) < to_int(a2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
inline bool operator<(const mystring& x, const unsigned y)
|
||||||
|
{
|
||||||
|
return to_int(x) < y;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator<(const unsigned y, const mystring& x)
|
||||||
|
{
|
||||||
|
return y < to_int(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void sort_by_value(T& x);
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void sort_by_value_(T& v, long)
|
||||||
|
{
|
||||||
|
std::sort(v.begin(), v.end(), cmp());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void random_sorted_sequence(T& seq)
|
||||||
|
{
|
||||||
|
seq.clear();
|
||||||
|
for (std::size_t i = 0; i < sequence_length; ++i)
|
||||||
|
{
|
||||||
|
push_back_random_number_string(seq);
|
||||||
|
}
|
||||||
|
sort_by_value(seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T, class A>
|
||||||
|
void sort_by_value_(std::list<T,A>& l, int)
|
||||||
|
{
|
||||||
|
# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) && !defined(__SGI_STL_PORT)
|
||||||
|
// VC6's standard lib doesn't have a template member function for list::sort()
|
||||||
|
std::vector<T> seq;
|
||||||
|
seq.reserve(sequence_length);
|
||||||
|
std::copy(l.begin(), l.end(), std::back_inserter(seq));
|
||||||
|
sort_by_value(seq);
|
||||||
|
std::copy(seq.begin(), seq.end(), l.begin());
|
||||||
|
# else
|
||||||
|
l.sort(cmp());
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void sort_by_value(T& x)
|
||||||
|
{
|
||||||
|
(sort_by_value_)(x, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// A way to select the comparisons with/without a Compare parameter for testing.
|
||||||
|
template <class Compare> struct searches
|
||||||
|
{
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static Iterator lower_bound(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||||
|
{ return boost::detail::lower_bound(start, finish, key, cmp); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static Iterator upper_bound(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||||
|
{ return boost::detail::upper_bound(start, finish, key, cmp); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static std::pair<Iterator, Iterator> equal_range(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||||
|
{ return boost::detail::equal_range(start, finish, key, cmp); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static bool binary_search(Iterator start, Iterator finish, Key key, Compare cmp)
|
||||||
|
{ return boost::detail::binary_search(start, finish, key, cmp); }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct no_compare {};
|
||||||
|
|
||||||
|
template <> struct searches<no_compare>
|
||||||
|
{
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static Iterator lower_bound(Iterator start, Iterator finish, Key key, no_compare)
|
||||||
|
{ return boost::detail::lower_bound(start, finish, key); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static Iterator upper_bound(Iterator start, Iterator finish, Key key, no_compare)
|
||||||
|
{ return boost::detail::upper_bound(start, finish, key); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static std::pair<Iterator, Iterator> equal_range(Iterator start, Iterator finish, Key key, no_compare)
|
||||||
|
{ return boost::detail::equal_range(start, finish, key); }
|
||||||
|
|
||||||
|
template <class Iterator, class Key>
|
||||||
|
static bool binary_search(Iterator start, Iterator finish, Key key, no_compare)
|
||||||
|
{ return boost::detail::binary_search(start, finish, key); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class Sequence, class Compare>
|
||||||
|
void test_loop(Sequence& x, Compare cmp, unsigned long test_count)
|
||||||
|
{
|
||||||
|
typedef typename Sequence::const_iterator const_iterator;
|
||||||
|
|
||||||
|
for (unsigned long i = 0; i < test_count; ++i)
|
||||||
|
{
|
||||||
|
random_sorted_sequence(x);
|
||||||
|
const const_iterator start = x.begin();
|
||||||
|
const const_iterator finish = x.end();
|
||||||
|
|
||||||
|
unsigned key = random_number();
|
||||||
|
const const_iterator l = searches<Compare>::lower_bound(start, finish, key, cmp);
|
||||||
|
const const_iterator u = searches<Compare>::upper_bound(start, finish, key, cmp);
|
||||||
|
|
||||||
|
bool found_l = false;
|
||||||
|
bool found_u = false;
|
||||||
|
std::size_t index = 0;
|
||||||
|
std::size_t count = 0;
|
||||||
|
unsigned last_value = 0;
|
||||||
|
(void)last_value;
|
||||||
|
for (const_iterator p = start; p != finish; ++p)
|
||||||
|
{
|
||||||
|
if (p == l)
|
||||||
|
found_l = true;
|
||||||
|
|
||||||
|
if (p == u)
|
||||||
|
{
|
||||||
|
assert(found_l);
|
||||||
|
found_u = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned value = to_int(*p);
|
||||||
|
assert(value >= last_value);
|
||||||
|
last_value = value;
|
||||||
|
|
||||||
|
if (!found_l)
|
||||||
|
{
|
||||||
|
++index;
|
||||||
|
assert(to_int(*p) < key);
|
||||||
|
}
|
||||||
|
else if (!found_u)
|
||||||
|
{
|
||||||
|
++count;
|
||||||
|
assert(to_int(*p) == key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
assert(to_int(*p) > key);
|
||||||
|
}
|
||||||
|
assert(found_l || l == finish);
|
||||||
|
assert(found_u || u == finish);
|
||||||
|
|
||||||
|
std::pair<const_iterator, const_iterator>
|
||||||
|
range = searches<Compare>::equal_range(start, finish, key, cmp);
|
||||||
|
assert(range.first == l);
|
||||||
|
assert(range.second == u);
|
||||||
|
|
||||||
|
bool found = searches<Compare>::binary_search(start, finish, key, cmp);
|
||||||
|
(void)found;
|
||||||
|
assert(found == (u != l));
|
||||||
|
std::cout << "found " << count << " copies of " << key << " at index " << index << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
string_vector x;
|
||||||
|
std::cout << "=== testing random-access iterators with <: ===\n";
|
||||||
|
test_loop(x, no_compare(), 25);
|
||||||
|
std::cout << "=== testing random-access iterators with compare: ===\n";
|
||||||
|
test_loop(x, cmp(), 25);
|
||||||
|
|
||||||
|
std::list<mystring> y;
|
||||||
|
std::cout << "=== testing bidirectional iterators with <: ===\n";
|
||||||
|
test_loop(y, no_compare(), 25);
|
||||||
|
std::cout << "=== testing bidirectional iterators with compare: ===\n";
|
||||||
|
test_loop(y, cmp(), 25);
|
||||||
|
std::cerr << "******TEST PASSED******\n";
|
||||||
|
return 0;
|
||||||
|
}
|
39
test/container_fwd/Jamfile
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
# Copyright 2011 Daniel James.
|
||||||
|
# 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 testing ;
|
||||||
|
|
||||||
|
project detail/test/container_fwd
|
||||||
|
: requirements
|
||||||
|
<warnings>all
|
||||||
|
<toolset>intel:<warnings>on
|
||||||
|
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||||
|
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||||
|
<toolset>clang:<cxxflags>"-pedantic -Wextra -Wmismatched-tags"
|
||||||
|
<warnings-as-errors>on
|
||||||
|
;
|
||||||
|
|
||||||
|
run container_no_fwd_test.cpp ;
|
||||||
|
run container_fwd_test.cpp : : : : container_fwd ;
|
||||||
|
run container_fwd_test.cpp : :
|
||||||
|
: <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||||
|
: container_fwd_debug ;
|
||||||
|
|
||||||
|
# The 'correctly_disable' tests fail if forward declaring standard types
|
||||||
|
# could work, but is currently not being done. Unfortunately, this if often
|
||||||
|
# the case - but we can't detect it, so the tests fail and there's not much
|
||||||
|
# we can do. There are also problems because some compilers don't support
|
||||||
|
# the debug version of their libraries. So I felt it was best to stop these
|
||||||
|
# tests from running in a normal test run..
|
||||||
|
|
||||||
|
compile-fail correctly_disable_fail.cpp
|
||||||
|
: <warnings-as-errors>off
|
||||||
|
: correctly_disable ;
|
||||||
|
compile-fail correctly_disable_fail.cpp
|
||||||
|
: <warnings-as-errors>off <define>_STLP_DEBUG <define>_GLIBCXX_DEBUG
|
||||||
|
: correctly_disable_debug ;
|
||||||
|
|
||||||
|
explicit correctly_disable ;
|
||||||
|
explicit correctly_disable_debug ;
|
112
test/container_fwd/container_fwd_test.cpp
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
|
||||||
|
// Copyright 2005-2009 Daniel James.
|
||||||
|
// 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/detail/container_fwd.hpp>
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__GNUC__, < 3) && \
|
||||||
|
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
|
||||||
|
template <class charT, class Allocator>
|
||||||
|
static void test(
|
||||||
|
std::basic_string<charT, std::string_char_traits<charT>, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
template <class charT, class Allocator>
|
||||||
|
static void test(
|
||||||
|
std::basic_string<charT, std::char_traits<charT>, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class T, class Allocator>
|
||||||
|
static void test(std::deque<T, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T, class Allocator>
|
||||||
|
static void test(std::list<T, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T, class Allocator>
|
||||||
|
static void test(std::vector<T, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Key, class T, class Compare, class Allocator>
|
||||||
|
static void test(std::map<Key, T, Compare, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Key, class T, class Compare, class Allocator>
|
||||||
|
static void test(std::multimap<Key, T, Compare, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Key, class Compare, class Allocator>
|
||||||
|
static void test(std::set<Key, Compare, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Key, class Compare, class Allocator>
|
||||||
|
static void test(std::multiset<Key, Compare, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <std::size_t N>
|
||||||
|
static void test(std::bitset<N> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
static void test(std::complex<T> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class X, class Y>
|
||||||
|
static void test(std::pair<X, Y> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <deque>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <bitset>
|
||||||
|
#include <string>
|
||||||
|
#include <complex>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::deque<int> x1;
|
||||||
|
std::list<std::string> x2;
|
||||||
|
std::vector<float> x3;
|
||||||
|
std::vector<bool> x4;
|
||||||
|
std::map<int, int> x5;
|
||||||
|
std::multimap<float, int*> x6;
|
||||||
|
std::set<std::string> x7;
|
||||||
|
std::multiset<std::vector<int> > x8;
|
||||||
|
std::bitset<10> x9;
|
||||||
|
std::string x10;
|
||||||
|
std::complex<double> x11;
|
||||||
|
std::pair<std::list<int>, char***> x12;
|
||||||
|
|
||||||
|
test(x1);
|
||||||
|
test(x2);
|
||||||
|
test(x3);
|
||||||
|
test(x4);
|
||||||
|
test(x5);
|
||||||
|
test(x6);
|
||||||
|
test(x7);
|
||||||
|
test(x8);
|
||||||
|
test(x9);
|
||||||
|
test(x10);
|
||||||
|
test(x11);
|
||||||
|
test(x12);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
14
test/container_fwd/container_no_fwd_test.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
// Copyright 2010 Daniel James.
|
||||||
|
// 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)
|
||||||
|
|
||||||
|
#define BOOST_DETAIL_NO_CONTAINER_FWD
|
||||||
|
|
||||||
|
#include <boost/detail/container_fwd.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::set<int> x;
|
||||||
|
std::vector<std::string> y;
|
||||||
|
}
|
43
test/container_fwd/correctly_disable_fail.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
// Copyright 2011 Daniel James.
|
||||||
|
// 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)
|
||||||
|
|
||||||
|
// This tests if container forwarding is correctly disabled. If it isn't
|
||||||
|
// disabled it causes a compile error (which causes the test to pass).
|
||||||
|
// If it is disabled it tries container forwarding. If it doesn't work
|
||||||
|
// then there will be a compile error, indicating that it is correctly
|
||||||
|
// disabled. But if there isn't a compile error that indicates that
|
||||||
|
// container forwarding might work.
|
||||||
|
//
|
||||||
|
// Since this test only tries std::vector, it might get it wrong but I didn't
|
||||||
|
// want it to fail because of some incompatibility with a trickier class.
|
||||||
|
|
||||||
|
#define BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||||
|
#include <boost/detail/container_fwd.hpp>
|
||||||
|
|
||||||
|
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
|
||||||
|
#error "Failing in order to pass test"
|
||||||
|
#else
|
||||||
|
#define BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD
|
||||||
|
|
||||||
|
#undef BOOST_DETAIL_CONTAINER_FWD_HPP
|
||||||
|
#undef BOOST_DETAIL_TEST_CONFIG_ONLY
|
||||||
|
|
||||||
|
#include <boost/detail/container_fwd.hpp>
|
||||||
|
|
||||||
|
template <class T, class Allocator>
|
||||||
|
void test(std::vector<T, Allocator> const&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
std::vector<int> x;
|
||||||
|
test(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
137
test/is_sorted_test.cpp
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/*==============================================================================
|
||||||
|
Copyright (c) 2010-2011 Bryce Lelbach
|
||||||
|
|
||||||
|
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 <iostream>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/array.hpp>
|
||||||
|
#include <boost/detail/is_sorted.hpp>
|
||||||
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct tracking_less {
|
||||||
|
typedef bool result_type;
|
||||||
|
typedef T first_argument_type;
|
||||||
|
typedef T second_argument_type;
|
||||||
|
|
||||||
|
#if defined(__PATHSCALE__)
|
||||||
|
tracking_less (void) { }
|
||||||
|
~tracking_less (void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool operator() (T const& x, T const& y) const {
|
||||||
|
std::cout << x << " < " << y << " == " << (x < y) << "\n";
|
||||||
|
return x < y;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct tracking_less_equal {
|
||||||
|
typedef bool result_type;
|
||||||
|
typedef T first_argument_type;
|
||||||
|
typedef T second_argument_type;
|
||||||
|
|
||||||
|
#if defined(__PATHSCALE__)
|
||||||
|
tracking_less_equal (void) { }
|
||||||
|
~tracking_less_equal (void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool operator() (T const& x, T const& y) const {
|
||||||
|
std::cout << x << " <= " << y << " == " << (x <= y) << "\n";
|
||||||
|
return x <= y;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct tracking_greater {
|
||||||
|
typedef bool result_type;
|
||||||
|
typedef T first_argument_type;
|
||||||
|
typedef T second_argument_type;
|
||||||
|
|
||||||
|
#if defined(__PATHSCALE__)
|
||||||
|
tracking_greater (void) { }
|
||||||
|
~tracking_greater (void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool operator() (T const& x, T const& y) const {
|
||||||
|
std::cout << x << " > " << y << " == " << (x > y) << "\n";
|
||||||
|
return x > y;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct tracking_greater_equal {
|
||||||
|
typedef bool result_type;
|
||||||
|
typedef T first_argument_type;
|
||||||
|
typedef T second_argument_type;
|
||||||
|
|
||||||
|
#if defined(__PATHSCALE__)
|
||||||
|
tracking_greater_equal (void) { }
|
||||||
|
~tracking_greater_equal (void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool operator() (T const& x, T const& y) const {
|
||||||
|
std::cout << x << " >= " << y << " == " << (x >= y) << "\n";
|
||||||
|
return x >= y;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int main (void) {
|
||||||
|
#define IS_SORTED ::boost::detail::is_sorted
|
||||||
|
#define IS_SORTED_UNTIL ::boost::detail::is_sorted_until
|
||||||
|
using boost::array;
|
||||||
|
using boost::report_errors;
|
||||||
|
|
||||||
|
std::cout << std::boolalpha;
|
||||||
|
|
||||||
|
array<int, 10> a = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } };
|
||||||
|
array<int, 10> b = { { 0, 1, 1, 2, 5, 8, 13, 34, 55, 89 } };
|
||||||
|
array<int, 10> c = { { 0, 1, -1, 2, -3, 5, -8, 13, -21, 34 } };
|
||||||
|
|
||||||
|
tracking_less<int> lt;
|
||||||
|
tracking_less_equal<int> lte;
|
||||||
|
tracking_greater<int> gt;
|
||||||
|
tracking_greater_equal<int> gte;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end()), a.end());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lt), a.end());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lte), a.end());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.rbegin(), a.rend(), gt).base(), a.rend().base());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(a.rbegin(), a.rend(), gte).base(), a.rend().base());
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end()), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lt), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lte), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gt), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gte), true);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end()), b.end());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lt), b.end());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lte), &b[2]);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.rbegin(), b.rend(), gt).base(), b.rend().base());
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(b.rbegin(), b.rend(), gte).base(), &b[2]);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end()), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lt), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lte), false);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gt), true);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gte), false);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end()), &c[2]);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lt), &c[2]);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lte), &c[2]);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.rbegin(), c.rend(), gt).base(), &c[8]);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED_UNTIL(c.rbegin(), c.rend(), gte).base(), &c[8]);
|
||||||
|
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end()), false);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lt), false);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lte), false);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gt), false);
|
||||||
|
BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gte), false);
|
||||||
|
|
||||||
|
return report_errors();
|
||||||
|
}
|
289
test/test_utf8_codecvt.cpp
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||||
|
// test_utf8_codecvt.cpp
|
||||||
|
|
||||||
|
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||||
|
// Use, modification and distribution is subject to the Boost Software
|
||||||
|
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <algorithm> // std::copy
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iterator>
|
||||||
|
#include <locale>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <cstddef> // size_t
|
||||||
|
#include <cwchar>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#define BOOST_UTF8_BEGIN_NAMESPACE namespace boost { namespace detail {
|
||||||
|
#define BOOST_UTF8_END_NAMESPACE } }
|
||||||
|
#include <boost/detail/utf8_codecvt_facet.hpp>
|
||||||
|
#include <boost/detail/utf8_codecvt_facet.ipp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
|
namespace std{
|
||||||
|
using ::size_t;
|
||||||
|
using ::wcslen;
|
||||||
|
#if !defined(UNDER_CE) && !defined(__PGIC__)
|
||||||
|
using ::w_int;
|
||||||
|
#endif
|
||||||
|
} // namespace std
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Note: copied from boost/iostreams/char_traits.hpp
|
||||||
|
//
|
||||||
|
// Dinkumware that comes with QNX Momentics 6.3.0, 4.0.2, incorrectly defines
|
||||||
|
// the EOF and WEOF macros to not std:: qualify the wint_t type (and so does
|
||||||
|
// Sun C++ 5.8 + STLport 4). Fix by placing the def in this scope.
|
||||||
|
// NOTE: Use BOOST_WORKAROUND?
|
||||||
|
#if (defined(__QNX__) && defined(BOOST_DINKUMWARE_STDLIB)) \
|
||||||
|
|| defined(__SUNPRO_CC)
|
||||||
|
using ::std::wint_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
template<std::size_t s>
|
||||||
|
struct test_data
|
||||||
|
{
|
||||||
|
static unsigned char utf8_encoding[];
|
||||||
|
static wchar_t wchar_encoding[];
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
unsigned char test_data<2>::utf8_encoding[] = {
|
||||||
|
0x01,
|
||||||
|
0x7f,
|
||||||
|
0xc2, 0x80,
|
||||||
|
0xdf, 0xbf,
|
||||||
|
0xe0, 0xa0, 0x80,
|
||||||
|
0xe7, 0xbf, 0xbf
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
wchar_t test_data<2>::wchar_encoding[] = {
|
||||||
|
0x0001,
|
||||||
|
0x007f,
|
||||||
|
0x0080,
|
||||||
|
0x07ff,
|
||||||
|
0x0800,
|
||||||
|
0x7fff
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
unsigned char test_data<4>::utf8_encoding[] = {
|
||||||
|
0x01,
|
||||||
|
0x7f,
|
||||||
|
0xc2, 0x80,
|
||||||
|
0xdf, 0xbf,
|
||||||
|
0xe0, 0xa0, 0x80,
|
||||||
|
0xef, 0xbf, 0xbf,
|
||||||
|
0xf0, 0x90, 0x80, 0x80,
|
||||||
|
0xf4, 0x8f, 0xbf, 0xbf,
|
||||||
|
/* codecvt implementations for clang and gcc don't handle more than 21 bits and
|
||||||
|
* return eof accordlingly. So don't test the whole 32 range
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
0xf7, 0xbf, 0xbf, 0xbf,
|
||||||
|
0xf8, 0x88, 0x80, 0x80, 0x80,
|
||||||
|
0xfb, 0xbf, 0xbf, 0xbf, 0xbf,
|
||||||
|
0xfc, 0x84, 0x80, 0x80, 0x80, 0x80,
|
||||||
|
0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
wchar_t test_data<4>::wchar_encoding[] = {
|
||||||
|
(wchar_t)0x00000001,
|
||||||
|
(wchar_t)0x0000007f,
|
||||||
|
(wchar_t)0x00000080,
|
||||||
|
(wchar_t)0x000007ff,
|
||||||
|
(wchar_t)0x00000800,
|
||||||
|
(wchar_t)0x0000ffff,
|
||||||
|
(wchar_t)0x00010000,
|
||||||
|
(wchar_t)0x0010ffff,
|
||||||
|
/* codecvt implementations for clang and gcc don't handle more than 21 bits and
|
||||||
|
* return eof accordlingly. So don't test the whole 32 range
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
(wchar_t)0x001fffff,
|
||||||
|
(wchar_t)0x00200000,
|
||||||
|
(wchar_t)0x03ffffff,
|
||||||
|
(wchar_t)0x04000000,
|
||||||
|
(wchar_t)0x7fffffff
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
test_main(int /* argc */, char * /* argv */[]) {
|
||||||
|
std::locale utf8_locale
|
||||||
|
= std::locale(
|
||||||
|
std::locale::classic(),
|
||||||
|
new boost::detail::utf8_codecvt_facet
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef char utf8_t;
|
||||||
|
// define test data compatible with the wchar_t implementation
|
||||||
|
// as either ucs-2 or ucs-4 depending on the compiler/library.
|
||||||
|
typedef test_data<sizeof(wchar_t)> td;
|
||||||
|
|
||||||
|
// Send our test UTF-8 data to file
|
||||||
|
{
|
||||||
|
std::ofstream ofs;
|
||||||
|
ofs.open("test.dat");
|
||||||
|
std::copy(
|
||||||
|
td::utf8_encoding,
|
||||||
|
td::utf8_encoding + sizeof(td::utf8_encoding) / sizeof(unsigned char),
|
||||||
|
std::ostream_iterator<utf8_t>(ofs)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the test data back in, converting to UCS-4 on the way in
|
||||||
|
std::vector<wchar_t> from_file;
|
||||||
|
{
|
||||||
|
std::wifstream ifs;
|
||||||
|
ifs.imbue(utf8_locale);
|
||||||
|
ifs.open("test.dat");
|
||||||
|
|
||||||
|
std::wint_t item = 0;
|
||||||
|
// note can't use normal vector from iterator constructor because
|
||||||
|
// dinkumware doesn't have it.
|
||||||
|
for(;;){
|
||||||
|
item = ifs.get();
|
||||||
|
if(item == WEOF)
|
||||||
|
break;
|
||||||
|
//ifs >> item;
|
||||||
|
//if(ifs.eof())
|
||||||
|
// break;
|
||||||
|
from_file.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_TEST(std::equal(from_file.begin(), from_file.end(), td::wchar_encoding));
|
||||||
|
|
||||||
|
// Send the UCS4_data back out, converting to UTF-8
|
||||||
|
{
|
||||||
|
std::wofstream ofs;
|
||||||
|
ofs.imbue(utf8_locale);
|
||||||
|
ofs.open("test2.dat");
|
||||||
|
std::copy(
|
||||||
|
from_file.begin(),
|
||||||
|
from_file.end(),
|
||||||
|
std::ostream_iterator<wchar_t, wchar_t>(ofs)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure that both files are the same
|
||||||
|
{
|
||||||
|
typedef std::istream_iterator<utf8_t> is_iter;
|
||||||
|
is_iter end_iter;
|
||||||
|
|
||||||
|
std::ifstream ifs1("test.dat");
|
||||||
|
is_iter it1(ifs1);
|
||||||
|
std::vector<utf8_t> data1;
|
||||||
|
std::copy(it1, end_iter, std::back_inserter(data1));
|
||||||
|
|
||||||
|
std::ifstream ifs2("test2.dat");
|
||||||
|
is_iter it2(ifs2);
|
||||||
|
std::vector<utf8_t> data2;
|
||||||
|
std::copy(it2, end_iter, std::back_inserter(data2));
|
||||||
|
|
||||||
|
BOOST_TEST(data1 == data2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// some libraries have trouble that only shows up with longer strings
|
||||||
|
|
||||||
|
const wchar_t * test3_data = L"\
|
||||||
|
<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||||
|
<!DOCTYPE boost_serialization>\
|
||||||
|
<boost_serialization signature=\"serialization::archive\" version=\"3\">\
|
||||||
|
<a class_id=\"0\" tracking_level=\"0\">\
|
||||||
|
<b>1</b>\
|
||||||
|
<f>96953204</f>\
|
||||||
|
<g>177129195</g>\
|
||||||
|
<l>1</l>\
|
||||||
|
<m>5627</m>\
|
||||||
|
<n>23010</n>\
|
||||||
|
<o>7419</o>\
|
||||||
|
<p>16212</p>\
|
||||||
|
<q>4086</q>\
|
||||||
|
<r>2749</r>\
|
||||||
|
<c>-33</c>\
|
||||||
|
<s>124</s>\
|
||||||
|
<t>28</t>\
|
||||||
|
<u>32225</u>\
|
||||||
|
<v>17543</v>\
|
||||||
|
<w>0.84431422</w>\
|
||||||
|
<x>1.0170664757130923</x>\
|
||||||
|
<y>tjbx</y>\
|
||||||
|
<z>cuwjentqpkejp</z>\
|
||||||
|
</a>\
|
||||||
|
</boost_serialization>\
|
||||||
|
";
|
||||||
|
|
||||||
|
// Send the UCS4_data back out, converting to UTF-8
|
||||||
|
std::size_t l = std::wcslen(test3_data);
|
||||||
|
{
|
||||||
|
std::wofstream ofs;
|
||||||
|
ofs.imbue(utf8_locale);
|
||||||
|
ofs.open("test3.dat");
|
||||||
|
std::copy(
|
||||||
|
test3_data,
|
||||||
|
test3_data + l,
|
||||||
|
std::ostream_iterator<wchar_t, wchar_t>(ofs)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure that both files are the same
|
||||||
|
{
|
||||||
|
std::wifstream ifs;
|
||||||
|
ifs.imbue(utf8_locale);
|
||||||
|
ifs.open("test3.dat");
|
||||||
|
ifs >> std::noskipws;
|
||||||
|
BOOST_TEST(
|
||||||
|
std::equal(
|
||||||
|
test3_data,
|
||||||
|
test3_data + l,
|
||||||
|
std::istream_iterator<wchar_t, wchar_t>(ifs)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test length calculation
|
||||||
|
{
|
||||||
|
std::codecvt<wchar_t, char, std::mbstate_t> const& fac = std::use_facet< std::codecvt<wchar_t, char, std::mbstate_t> >(utf8_locale);
|
||||||
|
std::mbstate_t mbs = std::mbstate_t();
|
||||||
|
const int utf8_len = sizeof(td::utf8_encoding) / sizeof(*td::utf8_encoding);
|
||||||
|
int res = fac.length(mbs, reinterpret_cast< const char* >(td::utf8_encoding), reinterpret_cast< const char* >(td::utf8_encoding + utf8_len), ~static_cast< std::size_t >(0u));
|
||||||
|
BOOST_TEST_EQ(utf8_len, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char * argv[]){
|
||||||
|
|
||||||
|
int retval = 1;
|
||||||
|
BOOST_TRY{
|
||||||
|
retval = test_main(argc, argv);
|
||||||
|
}
|
||||||
|
#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE
|
||||||
|
BOOST_CATCH(const std::exception & e){
|
||||||
|
BOOST_ERROR(e.what());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
BOOST_CATCH(...){
|
||||||
|
BOOST_ERROR("failed with uncaught exception:");
|
||||||
|
}
|
||||||
|
BOOST_CATCH_END
|
||||||
|
|
||||||
|
int error_count = boost::report_errors();
|
||||||
|
if(error_count > 0)
|
||||||
|
retval = error_count;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|