| Home | Libraries | People | FAQ | More

#### Basics

###### Examples

All sections in the reference present some real world examples. The examples use a common test harness to keep the example code as minimal and direct to the point as possible. The test harness is presented below.

Some includes:

    #include <boost/spirit/include/lex.hpp>
    #include <boost/spirit/include/phoenix_core.hpp>
    #include <boost/spirit/include/phoenix_operator.hpp>
    #include <iostream>
    #include <string>

Our test functions:

This one tests token definitions.

###### Models

Predefined models include:

- any literal string, e.g. "Hello, World",
- a pointer/reference to a null-terminated array of characters
- a `std::basic_string<Char>`

The namespace `boost::spirit::traits` is open for users to provide their own specializations.