Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
End of Line Generator (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] 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/support_utree.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
#include <boost/fusion/include/std_pair.hpp>
#include <boost/proto/deep_copy.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);


PrevUpHomeNext