[spirit-x3]What's use case for x3::variant<OnlyOneComponent>?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[spirit-x3]What's use case for x3::variant<OnlyOneComponent>?

Boost - Dev mailing list
Since:


http://www.boost.org/doc/libs/1_65_0/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html

doesn't mention a unary variant:

   variant<A>

and the comments in:


https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/qi/operator/alternative.hpp#L59

indicates variant<T> is collapsed to T, why isn't the x3::variant here:


https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/support/ast/variant.hpp#L121

declared as:

   template <typename L, typename R, typename ...Types>
   struct variant

instead of:

   template <typename ...Types>
   struct variant

which allows sizeof...(Types)==0 instead of the minimum
size of 2? That would disallow the primary and factor
using's here:

https://stackoverflow.com/questions/43791079/x3-linker-error-with-separate-tu

which make no sense because, for example, primary_def is *not*
an alternative parser.

-regards.
Larry



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost