Writing this to mainly check if this is worth creating a merge request.
I ran into a compilation error when one of my projects was compiling a CUDA C file that inevitably #includes uuid.h. The nvcc compiler returns an error when trying to deduce the data in empty_guid and guid_encoder for CharT types:
/usr/local/include/uuid.h(298): error: a value of type "const char [37]" cannot be used to initialize an entity of type "const CharT [37]"
/usr/local/include/uuid.h(304): error: a value of type "const char [17]" cannot be used to initialize an entity of type "const CharT [17]"
What worked for me was changing the initialization of the value. At compile time, writing the rhs as a const char[37] with double quotes only deduces to a const char array. You can implicitly call std::initializer_list so the compiler deduces all types of CharT:
Writing this to mainly check if this is worth creating a merge request.
I ran into a compilation error when one of my projects was compiling a CUDA C file that inevitably
#include
suuid.h
. Thenvcc
compiler returns an error when trying to deduce the data inempty_guid
andguid_encoder
forCharT
types:What worked for me was changing the initialization of the value. At compile time, writing the rhs as a
const char[37]
with double quotes only deduces to a const char array. You can implicitly callstd::initializer_list
so the compiler deduces all types ofCharT
:Regardless of how the project was configured, template initialization should be written to account for the generic type.