gul-cpp / gul14

General Utility Library for C++14
https://gul14.info/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Add a backport of std::variant from C++17 #43

Closed alt-graph closed 1 year ago

alt-graph commented 1 year ago

This pull request adds a gul14::variant with the same API as C++17's std::variant. The implementation is based on version 1.4.0 of the variant library by Michael Park (https://github.com/mpark/variant). Multiple header files from the original source have been merged into a single file, and multiple conditional compilation blocks have been removed because GUL14 does not support pre-C++14 compilers.

Because of conflicting definitions, I have also extracted a few types and metafunctions so that they can be shared between variant, optional, expected, and span (and GUL14 users in general).

I assume this becomes version 2.9.0 when merged.

alt-graph commented 1 year ago

Apparently we have to live with C++14 for a while longer because of the RasPis... so here's an implementation of variant for GUL14. Please have a look.

alt-graph commented 1 year ago

Thanks, @Finii! I'll release this as 2.9 and we're right on time for the DOOCS release next week.