diff --git a/doc/intro.qbk b/doc/intro.qbk index 1748bcc9..3c5d7abc 100644 --- a/doc/intro.qbk +++ b/doc/intro.qbk @@ -100,6 +100,23 @@ significantly increase compile times. Also, MSVC seems to have a hard time with large values; I successfully set this value to `50` on MSVC, but `100` broke the MSVC build entirely. +_Parser_ uses `std::optional` and `std::variant` internally. There is no way +to change this. However, when _Parse_ generates values as a result of the +parse (see _attr_gen_), it can place them into other implementations of +optional and/or variant, if you tell it to do so. You tell it which templates +are usable as an optional or variant by specializing the associated variable +template. For instance, here is how you would tell _Parser_ that +`boost::optional` is an optional-type: + + template + constexpr bool boost::parser::enable_optional> = true; + +Here's how you would do the same thing for `boost::variant2::variant`: + + template + constexpr bool boost::parser::enable_optional> = true; + + [endsect] [section This Library's Relationship to Boost.Spirit]