eggs-cpp / variant

Eggs.Variant is a C++11/14/17 generic, type-safe, discriminated union.
http://eggs-cpp.github.io/variant/
Boost Software License 1.0
137 stars 27 forks source link

Support building without RTTI and exceptions #11

Closed blastrock closed 9 years ago

blastrock commented 9 years ago

Same as #10 but on develop.

Here are the differences:

About the guesses, the macro I took are from https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html for gcc. These macros are supported by clang (tested on clang 3.6 only though). For MSVC, I took them from https://msdn.microsoft.com/en-us/library/b0084kay.aspx .

I don't have any MSVC installed, I couldn't test compiling on it.

Btw, the tests do not compile with these flags on (as expected), but I'm not sure it's worth the effort making them compatible.

K-ballo commented 9 years ago

Thanks!

Btw, the tests do not compile with these flags on (as expected), but I'm not sure it's worth the effort making them compatible.

I overlooked that. I will definitively be needing tests to maintain this configuration, but I'll take it from here as I will be dropping any non essential target_type checks.

K-ballo commented 9 years ago

This has been now merged to master.

Unfortunately Catch does not compile when exceptions are disabled, so that configuration won't be actively tested. As for rtti, I found out that I had already taken care of non-essential target_type checks, so it was just a matter of guarding them with the config macro.

blastrock commented 9 years ago

This has been now merged to master.

Great, thanks!

Unfortunately Catch does not compile when exceptions are disabled

Oh indeed, that's more troublesome. If you break that configuration, I'll make another PR anyway :)