Open Kojoley opened 6 years ago
Updated the code for a single and zero attribute sequences.
Go for it! 👍 I've been wanting to do that for X3 for a long time now.
Well, I have discovered that Fusion heavily relies on MPL, includes a lot of support headers, and some of fusion::traits is not ::value
friendly (like is_associative
).
Also, some of Spirit traits (like is_substitute
or variant_find_substitute
) are not properly tested. This makes the work on replacing them error prone.
Well, I have discovered that Fusion heavily relies on MPL
True. And it will take a lot of effort to decouple MPL from Fusion, not that it can't be done... But I am not sure it's worth the effort.
Sigh, boost::variant
also uses MPL a lot. It is a surprise why MPL is not updated for C++11 if so many boost libraries uses it.
Have you considered moving to mp11 (for the cases where std c++14 facilities are not enough)?
There is no need in meta-programming libraries for X3, but MPL is required to access MPL interfaces of boost::variant
and Fusion sequences.
Currently X3 uses MPL which is still not updated for C++11. It is slow, even including it adds a big time overhead (see benchmarks on hana docs), but actually it is used intensively only in a few places. What if we rewrite them without MPL?
Example: https://github.com/boostorg/spirit/blob/49587ff7a04d0301d798d080e541f45debbb737f/include/boost/spirit/home/x3/operator/detail/sequence.hpp#L237-L294
This could be easily done without any meta-library (and twice shorter):
http://coliru.stacked-crooked.com/a/404f73f1f2340091
Proof of concept code
```cpp #includeChecked on GCC 4.7.3, Clang 3.2, MSVC 14.0