uuid_v4 icon indicating copy to clipboard operation
uuid_v4 copied to clipboard

C2589 error in uuid_v4.h

Open devjamescockfield opened this issue 1 year ago • 0 comments

I have just tried to import this into my project and I am getting a C2589 error: '(': illegal token on right side of '::'.

This is the related code and this occurs for the ::min() part of the bellow lines.

    UUIDGenerator() : generator(new RNG(std::random_device()())), distribution(std::numeric_limits<uint64_t>::min(), std::numeric_limits<uint64_t>::max())
    {}

    UUIDGenerator(uint64_t seed) : generator(new RNG(seed)), distribution(std::numeric_limits<uint64_t>::min(), std::numeric_limits<uint64_t>::max())
    {}

    UUIDGenerator(RNG &gen) : generator(gen), distribution(std::numeric_limits<uint64_t>::min(), std::numeric_limits<uint64_t>::max())
    {}

I have tried the following code however this error flags up in VS22

    UUIDv4::UUIDGenerator<std::mt19937_64> uuidGenerator;
    UUIDv4::UUID uuid = uuidGenerator.getUUID();

    std::string bytes1;
    uuid.bytes(bytes1);

I have included both the uuid_v4.h and the endianness.h in my includes folder also.

devjamescockfield avatar Jan 24 '24 01:01 devjamescockfield