Skip to content

Commit 9a138a2

Browse files
committed
Correct the claim in the docs that if_(c)[p] has attribute type
optional<ATTR(p)>; it actually has attribute type ATTR(p). Fixes #278.
1 parent c32d594 commit 9a138a2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

doc/rationale.qbk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,8 @@ Also, Spirit-style looseness is more complicated than `parser` above
261261
indicates. Remember, `int_ | eps` and `-int_` are supposed to be semantically
262262
equivalent. To do otherwise this would be a profound violation of the
263263
principle of least surprise. So, if they're equivalent, we would need to
264-
apply the same rule to `int_ | eps`. Also, we would probably need to apply it
265-
to `if_(cond)[int_]`, which is also a `std::optional<int>`. This is a lot to
266-
remember, and this is complicated to implement and maintain.
264+
apply the same rule to `int_ | eps`. This is a lot to remember, and this is
265+
complicated to implement and maintain.
267266

268267
I've been using Spirit 1 and later Spirit 2 since they were released. I did
269268
not know about the particular looseness discussed here; a user pointed it out

doc/tables.qbk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ the input they match unless otherwise stated in the table below.]
319319

320320
[[ `_if_np_(pred)[p]` ]
321321
[ Equivalent to `_e_(pred) >> p`. ]
322-
[ `std::optional<_ATTR_np_(p)>` ]
322+
[ `_ATTR_np_(p)` ]
323323
[ It is an error to write `_if_np_(pred)`. That is, it is an error to omit the conditionally matched parser `p`. ]]
324324

325325
[[ `_sw_np_(arg0)(arg1, p1)(arg2, p2) ...` ]
@@ -557,7 +557,7 @@ tables below:
557557

558558
[[`_rpt_np_(arg0)[p]`] [`std::string` if `_ATTR_np_(p)` is `char` or `char32_t`, otherwise `std::vector<_ATTR_np_(p)>`]]
559559
[[`_rpt_np_(arg0, arg1)[p]`] [`std::string` if `_ATTR_np_(p)` is `char` or `char32_t`, otherwise `std::vector<_ATTR_np_(p)>`]]
560-
[[`_if_np_(pred)[p]`] [`std::optional<_ATTR_np_(p)>`]]
560+
[[`_if_np_(pred)[p]`] [`_ATTR_np_(p)`]]
561561
[[`_sw_np_(arg0)(arg1, p1)(arg2, p2)...`]
562562
[`std::variant<_ATTR_np_(p1), _ATTR_np_(p2), ...>`]]
563563
]

0 commit comments

Comments
 (0)