#include "GuidParser.hpp"
#include <algorithm> //std::ranges::equal
#include <array> //std::array
#include <iostream> //std::cout
using namespace GuidParser::GuidLiteral;
static constexpr GUID guid = "{20f892f5-b841-4c46-8547-7d2e7687a30a}"_guid;
int main()
{
static constexpr std::array<std::uint8_t, 8> MyData4 = { 133, 71, 125, 46, 118, 135, 163, 10 };
static_assert(guid.Data1 == 553161461 && guid.Data2 == 47169
&& guid.Data3 == 19526 && std::ranges::equal(MyData4, guid.Data4));
static constexpr auto stringGuid = GuidParser::GuidToString(guid);
std::cout << "static_assert for " << stringGuid.data() << " passed\n";
std::optional<GUID> optionalGuid = GuidParser::StringToGuid("{474ccf9f-bad7-48e2-b7c6-df307b74e4a5}");
if (optionalGuid.has_value())
{
return 0;
}
return -1;
}
-
Notifications
You must be signed in to change notification settings - Fork 0
C++20 constexpr guid parser and consteval guid literal.
License
bogu9821/GuidParserConstexpr
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
C++20 constexpr guid parser and consteval guid literal.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published