libfn / functional

Extending C++ library for functional programming
ISC License
60 stars 8 forks source link

Remove `-D__cpp_concepts=202002` hack from `CMakeLists.txt` #39

Closed Bronek closed 6 months ago

Bronek commented 7 months ago

We are using stdlibc++ with clang because libc++ is lagging behind - specifically it does not implement std::expected type. On top of this, clang 17 does not seem to support all concept features required by std::expected implementation available in stdlibc++ (see discussion in r/cpp for more details). As a workaround I crossed my fingers and added -D__cpp_concepts=202002 -Wno-builtin-macro-redefined to CMakeLists.txt. This is rather ugly hack and the clang compiler would be in the right to miscompile any affected code (e.g. possible UB).

Since we have already rewritten the most difficult chunks of expected as fn::expected in this project, we should just finish the job, remove the dependency on #include <expected> and finally remove the hacky -D__cpp_concepts=202002.

jwakely commented 6 months ago

libc++ supports std::expected since clang 16

Bronek commented 6 months ago

Thanks @jwakely ; this is about monadic functions e.g. and_then

Bronek commented 6 months ago

Resolved with #57