From 9028f43fc9762bf195b5445e141210c23f690fd8 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Mon, 17 Aug 2009 23:36:52 +0000 Subject: [PATCH] MPL refmanual: add forgotten docs [SVN r55635] --- doc/refmanual/c-str.html | 137 ++++++++++++++++++++ doc/refmanual/char.html | 112 ++++++++++++++++ doc/refmanual/limit-string-size.html | 59 +++++++++ doc/refmanual/string-operations.html | 27 ++++ doc/refmanual/string.html | 183 +++++++++++++++++++++++++++ 5 files changed, 518 insertions(+) create mode 100644 doc/refmanual/c-str.html create mode 100644 doc/refmanual/char.html create mode 100644 doc/refmanual/limit-string-size.html create mode 100644 doc/refmanual/string-operations.html create mode 100644 doc/refmanual/string.html diff --git a/doc/refmanual/c-str.html b/doc/refmanual/c-str.html new file mode 100644 index 0000000..1bfba1e --- /dev/null +++ b/doc/refmanual/c-str.html @@ -0,0 +1,137 @@ + + + + + + +The MPL Reference Manual: c_str + + + + + +
Front Page / Metafunctions / String Operations / c_str
+
+

c_str

+
+

Synopsis

+
+template<
+      typename Sequence
+    >
+struct c_str
+{
+    typedef unspecified type;
+    static char const value[];
+};
+
+
+
+

Description

+

c_str converts the Forward Sequence of Integral Constants Sequence +into a null-terminated byte string containing an equivalent sequence.

+
+
+

Header

+
+#include <boost/mpl/string.hpp>
+
+
+ +
+

Parameters

+ +++++ + + + + + + + + + + + + +
ParameterRequirementDescription
SequenceForward Sequence of +Integral ConstantsA sequence to be converted into a +null-terminated byte string.
+
+
+

Expression semantics

+
+

For any Forward Sequence of Integral Constants s,

+
+c_str<s>::value;
+
+ +++ + + + + + + + +
Return type:

A null-terminated byte string.

+
Precondition:

size<s>::value <= BOOST_MPL_STRING_MAX_LENGTH.

+
Semantics:

Equivalent to

+
+char const value[] = {
+    at<s, 0>::type::value
+  , ...
+  , at<s, size<s>::value-1>::type::value
+  , '\0'
+};
+
+
+
+
+
+

Complexity

+ ++++ + + + + + + + + + + +
Sequence archetypeComplexity
Forward SequenceLinear.
+
+
+

Example

+
+typedef vector_c<char,'h','e','l','l','o'> hello;
+assert( 0 == std::strcmp( c_str<hello>::value, "hello" ) );
+
+
+ +
+ + + + + diff --git a/doc/refmanual/char.html b/doc/refmanual/char.html new file mode 100644 index 0000000..56c52f0 --- /dev/null +++ b/doc/refmanual/char.html @@ -0,0 +1,112 @@ + + + + + + +The MPL Reference Manual: char_ + + + + + +
Front Page / Data Types / Numeric / char_
+
+

char_

+
+

Synopsis

+
+template<
+      char N
+    >
+struct char_
+{
+    // unspecified
+    // ...
+};
+
+
+
+

Description

+

An Integral Constant wrapper for char.

+
+
+

Header

+
+#include <boost/mpl/char.hpp>
+
+
+ +
+

Parameters

+ +++++ + + + + + + + + + + + + +
ParameterRequirementDescription
NA character constantA value to wrap.
+
+
+

Expression semantics

+

The semantics of an expression are defined only +where they differ from, or are not defined in Integral Constant.

+

For arbitrary character constant c:

+ ++++ + + + + + + + + + + +
ExpressionSemantics
char_<c>An Integral Constant x such that x::value == c +and x::value_type is identical to char.
+
+
+

Example

+
+typedef char_<'c'> c;
+
+BOOST_MPL_ASSERT(( is_same< c::value_type, char > ));
+BOOST_MPL_ASSERT(( is_same< c::type, c > ));
+BOOST_MPL_ASSERT(( is_same< next< c >::type, char_<'d'> > ));
+BOOST_MPL_ASSERT(( is_same< prior< c >::type, char_<'b'> > ));
+BOOST_MPL_ASSERT_RELATION( (c::value), ==, 'c' );
+assert( c() == 'c' );
+
+
+ +
+ + + + + diff --git a/doc/refmanual/limit-string-size.html b/doc/refmanual/limit-string-size.html new file mode 100644 index 0000000..158ed9c --- /dev/null +++ b/doc/refmanual/limit-string-size.html @@ -0,0 +1,59 @@ + + + + + + +The MPL Reference Manual: BOOST_MPL_LIMIT_STRING_SIZE + + + + + +
Front Page / Macros / Configuration / BOOST_MPL_LIMIT_STRING_SIZE
+
+

BOOST_MPL_LIMIT_STRING_SIZE

+
+

Synopsis

+
+#if !defined(BOOST_MPL_LIMIT_STRING_SIZE)
+#   define BOOST_MPL_LIMIT_STRING_SIZE \
+        implementation-defined integral constant \
+/**/
+#endif
+
+
+
+

Description

+

BOOST_MPL_LIMIT_STRING_SIZE is an overridable configuration macro regulating +the maximum arity of the string's variadic forms. In this +implementation of the library, BOOST_MPL_LIMIT_STRING_SIZE has a default value +of 32. To override the default limit, define BOOST_MPL_LIMIT_STRING_SIZE to +the desired maximum arity before including any library header.

+
+
+

Example

+
+#define BOOST_MPL_LIMIT_STRING_SIZE 8
+#include <boost/mpl/string.hpp>
+
+using namespace boost::mpl;
+
+typedef string<'a'> s_1;
+typedef string<'abcd','efgh'> s_8;
+// typedef string<'abcd','efgh','i'> s_9; // error!
+
+
+ +
+ + + + + diff --git a/doc/refmanual/string-operations.html b/doc/refmanual/string-operations.html new file mode 100644 index 0000000..bf45ab8 --- /dev/null +++ b/doc/refmanual/string-operations.html @@ -0,0 +1,27 @@ + + + + + + +The MPL Reference Manual: String Operations + + + + + +
Front Page / Metafunctions / String Operations
+
+

String Operations

+ + +
+ + + + + diff --git a/doc/refmanual/string.html b/doc/refmanual/string.html new file mode 100644 index 0000000..85bb1a0 --- /dev/null +++ b/doc/refmanual/string.html @@ -0,0 +1,183 @@ + + + + + + +The MPL Reference Manual: string + + + + + +
Front Page / Sequences / Classes / string
+
+

string

+
+

Description

+

string is a variadic, bidirectional, extensible Integral Sequence Wrapper of +characters that supports amortized constant-time insertion and removal of elements at both ends, +and linear-time insertion and removal of elements in the middle. The parameters to string +are multi-character literals, giving a somewhat readable syntax for compile-time strings. +string can also be an argument to the c_str metafunction, which generates a +null-terminated character array that facilitates interoperability with runtime string +processing routines.

+
+
+

Header

+ ++++ + + + + + + + + + + +
Sequence formHeader
Variadic#include <boost/mpl/string.hpp>
+
+ +
+

Expression semantics

+

In the following table, s is an instance of string, pos and last are iterators +into s, r is a Forward Sequence of characters, n and x are Integral Constants, +and c1,c2,... cn are arbitrary (multi-)characters.

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpressionSemantics
+string<c1,c2,... cn>
+
+
string of characters c1,c2,... cn; see +Variadic Sequence.
+string<c1,c2,... cn>::type
+
+
Identical to string<c1,c2,... cn>; +see Variadic Sequence.
begin<s>::typeAn iterator pointing to the beginning of s; +see Bidirectional Sequence.
end<s>::typeAn iterator pointing to the end of s; +see Bidirectional Sequence.
size<s>::typeThe size of s; see Bidirectional Sequence.
empty<s>::typeA boolean Integral Constant c such that +c::value == true if and only if the sequence is empty; +see Bidirectional Sequence.
front<s>::typeThe first element in s; see +Bidirectional Sequence.
back<s>::typeThe last element in s; see +Bidirectional Sequence.
insert<s,pos,x>::typeA new string of following elements: +[begin<s>::type, pos), x, +[pos, end<s>::type); see Extensible Sequence.
insert_range<s,pos,r>::typeA new string of following elements: +[begin<s>::type, pos), +[begin<r>::type, end<r>::type) +[pos, end<s>::type); see Extensible Sequence.
erase<s,pos>::typeA new string of following elements: +[begin<s>::type, pos), +[next<pos>::type, end<s>::type); see +Extensible Sequence.
erase<s,pos,last>::typeA new string of following elements: +[begin<s>::type, pos), +[last, end<s>::type); see Extensible Sequence.
clear<s>::typeAn empty string; see Extensible Sequence.
push_back<s,x>::typeA new string of following elements: +[begin<s>::type, end<s>::type), x; +see Back Extensible Sequence.
pop_back<s>::typeA new string of following elements: +[begin<s>::type, prior< end<s>::type >::type); +see Back Extensible Sequence.
push_front<s,x>::typeA new string of following elements: +[begin<s>::type, end<s>::type), x; see Front Extensible Sequence.
pop_front<s>::typeA new string of following elements: +[next< begin<s>::type >::type, end<s>::type); +see Front Extensible Sequence.
c_str<s>::valueA null-terminated byte string such that +c_str<s>::value[n] is equal to the n-th +character in s, and +c_str<s>::value[size<s>::type::value] is '\0'.
+
+
+

Example

+
+typedef mpl::string<'hell','o wo','rld'> hello;
+typedef mpl::push_back<hello, mpl::char_<'!'> >::type hello2;
+
+BOOST_ASSERT(0 == std::strcmp(mpl::c_str<hello2>::value, "hello world!"));
+
+
+ +
+ + + + +