1 .. Metafunctions/String Operations//c_str |10
17 typedef |unspecified| type;
18 static char const value[];
25 ``c_str`` converts the |Forward Sequence| of |Integral Constant|\ s ``Sequence``
26 into a null-terminated byte string containing an equivalent sequence.
34 #include <boost/mpl/string.hpp>
46 +---------------+---------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===========================+===============================================+
49 | ``Sequence`` | |Forward Sequence| of | A sequence to be converted into a |
50 | | |Integral Constant|\ s | null-terminated byte string. |
51 +---------------+---------------------------+-----------------------------------------------+
58 :class: expression-semantics
60 For any |Forward Sequence| of |Integral Constant|\ s ``s``,
67 A null-terminated byte string.
70 ``size<s>::value <= BOOST_MPL_STRING_MAX_LENGTH``.
77 char const value[] = {
80 , at<s, size<s>::value-1>::type::value
87 +-------------------------------+-----------------------------------+
88 | Sequence archetype | Complexity |
89 +===============================+===================================+
90 | |Forward Sequence| | Linear. |
91 +-------------------------------+-----------------------------------+
98 typedef vector_c<char,'h','e','l','l','o'> hello;
99 assert( 0 == std::strcmp( c_str<hello>::value, "hello" ) );
104 |Forward Sequence|, |Integral Constant|, |string|
107 .. copyright:: Copyright © 2009 Eric Niebler
108 Distributed under the Boost Software License, Version 1.0. (See accompanying
109 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)