MCPcopy Create free account
hub / github.com/boostorg/spirit / adder

Function adder

example/qi/sum.cpp:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 //[tutorial_adder
42 template <typename Iterator>
43 bool adder(Iterator first, Iterator last, double& n)
44 {
45 bool r = qi::phrase_parse(first, last,
46
47 // Begin grammar
48 (
49 double_[ref(n) = _1] >> *(',' >> double_[ref(n) += _1])
50 )
51 ,
52 // End grammar
53
54 space);
55
56 if (first != last) // fail if we did not get a full match
57 return false;
58 return r;
59 }
60 //]
61}
62

Callers 1

mainFunction · 0.70

Calls 1

phrase_parseFunction · 0.50

Tested by

no test coverage detected