build: don't fully qualify the installation path
This commit is contained in:
parent
70fcf1e97d
commit
c64cd2eb29
@ -727,7 +727,7 @@ install (
|
|||||||
FILES
|
FILES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/libcruft.pc"
|
"${CMAKE_CURRENT_BINARY_DIR}/libcruft.pc"
|
||||||
DESTINATION
|
DESTINATION
|
||||||
"${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
|
"share/pkgconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
17
random.hpp
17
random.hpp
@ -16,6 +16,8 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
|
||||||
namespace cruft::random {
|
namespace cruft::random {
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@ -25,8 +27,19 @@ namespace cruft::random {
|
|||||||
initialise (void)
|
initialise (void)
|
||||||
{
|
{
|
||||||
// Approximate the state size of the generator by its size in bytes.
|
// Approximate the state size of the generator by its size in bytes.
|
||||||
std::array<unsigned,sizeof (GeneratorT) / sizeof (unsigned) + 1> seed;
|
std::array<unsigned,sizeof (GeneratorT) / sizeof (unsigned) + 1 + 1> seed;
|
||||||
std::generate (seed.begin (), seed.end (), std::random_device ());
|
std::generate_n (
|
||||||
|
seed.begin (),
|
||||||
|
seed.size () - 1,
|
||||||
|
std::random_device ()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Append the current time with the highest resolution we have
|
||||||
|
// available. This defends against instances where the implementation
|
||||||
|
// of std::random_device is actually deterministic.
|
||||||
|
seed[seed.size () - 1] = static_cast<unsigned> (
|
||||||
|
std::chrono::high_resolution_clock::now ().time_since_epoch ().count ()
|
||||||
|
);
|
||||||
|
|
||||||
std::seed_seq seq (seed.begin (), seed.end ());
|
std::seed_seq seq (seed.begin (), seed.end ());
|
||||||
return GeneratorT (seq);
|
return GeneratorT (seq);
|
||||||
|
Loading…
Reference in New Issue
Block a user