spacechild1 4 days ago

This looks nice! One thing I find particularly noteworthy:

- Faster uniform / normal distributions that produce same sequences on every platform

This is very useful if you want to reliably repeat simulations across platforms!

One question:

    template<class T>
    constexpr T& rand_choice(std::initializer_list<T> objects) noexcept;

Isn't this returning a reference to a local variable? In my understanding, 'objects' is destroyed when rand_choice() returns.

1
GeorgeHaldane 4 days ago

Thanks, that is indeed the case when list doesn't consist of literals, fixed in the new commit.