End of Line (eol)

| Home | Libraries | People | FAQ | More

##### End of Line (`eol`)

###### Description

The `eol` component generates a single newline character. It is equivalent to `lit('\n')` or simply '\n' (please see the `char_` generator module for more details).

###### Header

    // forwards to <boost/spirit/home/karma/auxiliary/eol.hpp>
    #include <boost/spirit/include/karma_eol.hpp>

Also, see Include Structure.

###### Namespace

Name
`boost::spirit::eol // alias: boost::spirit::karma::eol`

###### Model of

> `PrimitiveGenerator`

###### Expression Semantics

Semantics of an expression is defined only where it differs from, or is not defined in `PrimitiveGenerator`.

Expression | Semantics
--- | ---
`eol` | Create a component generating a single end of line character in the output. This generator never fails (unless the underlying output stream reports an error).

###### Attributes

Expression | Attribute
--- | ---
`eol` | `unused`

###### Complexity

> O(1)

The complexity is constant as a single character is generated in the output.

###### Example

| Note
The test harness for the example(s) below is presented in the Basics Examples section.

Some includes:

    #include <boost/spirit/include/karma.hpp>
    #include <boost/spirit/include/phoenix_core.hpp>
    #include <boost/spirit/include/phoenix_operator.hpp>
    #include <boost/fusion/include/std_pair.hpp>
    #include <iostream>
    #include <string>

Some using declarations:

    using boost::spirit::karma::eol;

Basic usage of the `eol` generator:

    test_generator("\n", eol);
    test_generator("abc\n", "abc" << eol);