...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
extract_c_string
returns
a pointer to an array of elements of a const character type. It is invoked
through a static method call
.
This customization point is responsible for handling it's own garbage
collecting; the lifetime of the returned C-string must be no shorter
than the lifetime of the string instance passed to the call
method.
#include <boost/spirit/home/support/string_traits.hpp>
Also, see Include Structure.
Note | |
---|---|
This header file does not need to be included directly by any user program as it is normally included by other Spirit header files relying on its content. |
Name |
---|
|
template <typename String> struct extract_c_string { typedef <unspecified> char_type; static char_type const* call (String const&); };
Parameter |
Description |
Default |
---|---|---|
|
A string type. |
none |
Notation
T
An arbitrary type.
Char
A character type.
Traits
A character traits type.
Allocator
A standard allocator type.
str
A string instance.
Expression |
Semantics |
---|---|
|
The return type of |
|
Extract a c-string of type |
Type |
Semantics |
---|---|
|
|
|
|
|
|
|
|
|
|
This customization point needs to be implemented whenever traits::is_string
is implemented.
If this customization point is implemented, the following other customization points need to be implemented as well.
Name |
When to implement |
---|---|
For string types whose underlying character type is not |
|
Whenever |
|
Whenever |