mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add User defined literal sprout::uuids::udl::_uuid
fix sprout::uuid::string_generator
This commit is contained in:
parent
dacf1f40ac
commit
d7fbadb62c
5 changed files with 55 additions and 4 deletions
40
sprout/uuid/udl.hpp
Normal file
40
sprout/uuid/udl.hpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
#ifndef SPROUT_UUID_UDL_HPP
|
||||
#define SPROUT_UUID_UDL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/uuid/uuid.hpp>
|
||||
|
||||
#if SPROUT_USE_USER_DEFINED_LITERALS
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/uuid/string_generator.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace uuids {
|
||||
namespace udl {
|
||||
//
|
||||
// _uuid
|
||||
//
|
||||
SPROUT_CONSTEXPR sprout::uuids::uuid operator "" _uuid(char const* s, std::size_t) {
|
||||
return sprout::uuids::string_generator()(s);
|
||||
}
|
||||
SPROUT_CONSTEXPR sprout::uuids::uuid operator "" _uuid(wchar_t const* s, std::size_t) {
|
||||
return sprout::uuids::string_generator()(s);
|
||||
}
|
||||
SPROUT_CONSTEXPR sprout::uuids::uuid operator "" _uuid(char16_t const* s, std::size_t) {
|
||||
return sprout::uuids::string_generator()(s);
|
||||
}
|
||||
SPROUT_CONSTEXPR sprout::uuids::uuid operator "" _uuid(char32_t const* s, std::size_t) {
|
||||
return sprout::uuids::string_generator()(s);
|
||||
}
|
||||
} // namespace uuids
|
||||
|
||||
using sprout::uuids::udl::operator "" _uuid;
|
||||
} // namespace udl
|
||||
|
||||
using sprout::uuids::udl::operator "" _uuid;
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #if SPROUT_USE_USER_DEFINED_LITERALS
|
||||
|
||||
#endif // #ifndef SPROUT_UUID_UDL_HPP
|
Loading…
Add table
Add a link
Reference in a new issue