Back to Arangodb

c_str

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/c-str.html

3.12.9.12.5 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / String Operations / c_str |

c_str

Synopsis

template<
      typename Sequence
    >
struct[c\_str](./c-str.html){
    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.

#include <[boost/mpl/string.hpp](../../../../boost/mpl/string.hpp)>

Model of

Metafunction

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](./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'
};

|

Complexity

Sequence archetypeComplexity
Forward SequenceLinear.

Example

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" ) );

See also

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) |