nlohmann / fifo_map

a FIFO-ordered associative container for C++
MIT License
177 stars 77 forks source link

Can not be compiled with clang-15 and libc++ #16

Open kraj opened 1 year ago

kraj commented 1 year ago

I am playing with clang-15 in Yocto and ended up with build errors in this compoent as below

/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__random/uniform_int_distribution.h:235:5: error: static assertion failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value':
    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/shuffle.h:154:35: note: in instantiation of function template specialization 'std::uniform_int_distribution<long>::operator()<Catch::RandomNumberGenerator>' requested here
            difference_type __i = __uid(__g, _Pp(0, __d));
                                  ^
/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nlohmann-fifo/1.0.0+gitAUTOINC+d732aaf9a3-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/shuffle.h:166:14: note: in instantiation of function template specialization 'std::__shuffle<std::_ClassicAlgPolicy, std::__wrap_iter<Catch::TestCase *>, std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
  (void)std::__shuffle<_ClassicAlgPolicy>(
             ^
test/thirdparty/catch/catch.hpp:6539:18: note: in instantiation of function template specialization 'std::shuffle<std::__wrap_iter<Catch::TestCase *>, Catch::RandomNumberGenerator &>' requested here
            std::shuffle( vector.begin(), vector.end(), rng );
                 ^
test/thirdparty/catch/catch.hpp:6557:44: note: in instantiation of function template specialization 'Catch::RandomNumberGenerator::shuffle<std::vector<Catch::TestCase>>' requested here
                    RandomNumberGenerator::shuffle( sorted );
                                           ^
1 warning and 1 error generated.

libc++ has started to drop stuff and move towards c++17 defaults. Perhaps time to start using the std::shuffle

jeffreypedigo commented 1 year ago

Same error that kraj reported earlier, is there a fix for this?