mariusbancila / stduuid

A C++17 cross-platform implementation for UUIDs
MIT License
742 stars 112 forks source link

Documentation clarification #49

Closed yca closed 2 years ago

yca commented 2 years ago

I'm trying to use this library for a cross-platform project but I'm taking GSL span errors. As far as I understand it is currently only possible to build the project using GSL?

mariusbancila commented 2 years ago

If span is supported by your compiler, then it's used. See this;

#ifdef __cpp_lib_span
   template <class ElementType, std::size_t Extent>
   using span = std::span<ElementType, Extent>;
#else
   template <class ElementType, std::ptrdiff_t Extent>
   using span = gsl::span<ElementType, Extent>;
#endif

What errors are you getting?

yca commented 2 years ago

I first tried on Windows, compiler is MSVC 16.11.31613 (MSVC 2019). It fell backed to GSL path and throw "undefined symbol gsl ..." kind of an error.

The thing is I thought since the library is a single header, I only copied the header to my project and not the GSL folder.

mariusbancila commented 2 years ago

std::span is only supported in VS 2019 16.6. So then you need to use GSL and you need this library, otherwise, it cannot work.