|  | Home | Libraries | People | FAQ | More | 
The not-predicate generator is used to test, whether the embedded generator fails, without generating any output. It succeeds if the embedded generator fails.
// forwards to <boost/spirit/home/karma/operator/not_predicate.hpp> #include <boost/spirit/include/karma_not_predicate.hpp>
Also, see Include Structure.
            Semantics of an expression is defined only where it differs from, or
            is not defined in UnaryGenerator.
          
| Expression | Semantics | 
|---|---|
| 
                       | 
                      The generator  | 
The not generator is implemented by redirecting all output produced by its embedded generator into a discarding device.
See Compound Attribute Notation.
| Expression | Attribute | 
|---|---|
| 
                       | 
                       | 
| ![[Note]](../../../../images/note.png) | Note | 
|---|---|
| 
              The attribute of the not-predicate is not always  | 
The overall complexity of the not-predicate generator is defined by the complexity of its embedded generator. The complexity of the not-predicate generator itself is O(1).
| ![[Note]](../../../../images/note.png) | 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/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::double_; using boost::spirit::karma::ascii::char_; using boost::spirit::karma::ascii::string; using boost::phoenix::ref;
Basic usage of a not predicate generator:
test_generator_attr("c", !char_('a') << 'b' | 'c', 'a'); test_generator_attr("b", !char_('a') << 'b' | 'c', 'x'); test_generator_attr("def", !string("123") << "abc" | "def", "123"); test_generator_attr("abc", !string("123") << "abc" | "def", "456");