3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/c-str.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / String Operations / c_str |
template<
typename Sequence
>
struct[c\_str](./c-str.html){
typedef_unspecified_type;
static char const value[];
};
c_str converts the Forward Sequence of Integral Constants Sequence into a null-terminated byte string containing an equivalent sequence.
#include <[boost/mpl/string.hpp](../../../../boost/mpl/string.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence of Integral Constants | A sequence to be converted into a null-terminated byte string. |
For any Forward Sequence of Integral Constants s,
[c\_str](./c-str.html)<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](./at.html)<s, 0>::type::value
, ...
,[at](./at.html)<s,[size](./size.html)<s>::value-1>::type::value
, '\0'
};
|
| Sequence archetype | Complexity |
|---|---|
| Forward Sequence | Linear. |
typedef[vector\_c](./vector-c.html)<char,'h','e','l','l','o'> hello;
assert( 0 == std::strcmp([c\_str](./c-str.html)<hello>::value, "hello" ) );
Forward Sequence, Integral Constant, string
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2009 Eric Niebler 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) |