uuid is class
noexcept on several functions
This commit is contained in:
parent
dee14f660d
commit
e0a781d245
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@
|
|||||||
/build/.gitignore
|
/build/.gitignore
|
||||||
|
|
||||||
build
|
build
|
||||||
|
/test/CMakeFiles/3.10.0/CompilerIdC/Debug/CompilerIdC.tlog
|
||||||
|
|||||||
12
P0959.md
12
P0959.md
@ -468,12 +468,12 @@ namespace std {
|
|||||||
static bool is_valid_uuid(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
static bool is_valid_uuid(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
||||||
|
|
||||||
template<class CharT = char>
|
template<class CharT = char>
|
||||||
static uuid from_string(CharT const * str);
|
static uuid from_string(CharT const * str) noexcept;
|
||||||
|
|
||||||
template<class CharT = char,
|
template<class CharT = char,
|
||||||
class Traits = std::char_traits<CharT>,
|
class Traits = std::char_traits<CharT>,
|
||||||
class Allocator = std::allocator<CharT>>
|
class Allocator = std::allocator<CharT>>
|
||||||
static uuid from_string(std::basic_string<CharT, Traits, Allocator> const & str);
|
static uuid from_string(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
||||||
private:
|
private:
|
||||||
template <class Elem, class Traits>
|
template <class Elem, class Traits>
|
||||||
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
||||||
@ -485,7 +485,7 @@ namespace std {
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
namespace std {
|
namespace std {
|
||||||
inline constexpr void swap(uuid & lhs, uuid & rhs);
|
inline constexpr void swap(uuid & lhs, uuid & rhs) noexcept;
|
||||||
|
|
||||||
template <class Elem, class Traits>
|
template <class Elem, class Traits>
|
||||||
std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
||||||
@ -493,7 +493,7 @@ namespace std {
|
|||||||
template<class CharT = char,
|
template<class CharT = char,
|
||||||
class Traits = std::char_traits<CharT>,
|
class Traits = std::char_traits<CharT>,
|
||||||
class Allocator = std::allocator<CharT>>
|
class Allocator = std::allocator<CharT>>
|
||||||
inline std::string to_string(uuid const & id);
|
inline std::basic_string<CharT, Traits, Allocator> to_string(uuid const & id);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -622,12 +622,12 @@ namespace std {
|
|||||||
static bool is_valid_uuid(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
static bool is_valid_uuid(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
||||||
|
|
||||||
template<class CharT = char>
|
template<class CharT = char>
|
||||||
static uuid from_string(CharT const * str);
|
static uuid from_string(CharT const * str) noexcept;
|
||||||
|
|
||||||
template<class CharT = char,
|
template<class CharT = char,
|
||||||
class Traits = std::char_traits<CharT>,
|
class Traits = std::char_traits<CharT>,
|
||||||
class Allocator = std::allocator<CharT>>
|
class Allocator = std::allocator<CharT>>
|
||||||
static uuid from_string(std::basic_string<CharT, Traits, Allocator> const & str);
|
static uuid from_string(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
|
||||||
private:
|
private:
|
||||||
template <class Elem, class Traits>
|
template <class Elem, class Traits>
|
||||||
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
|
||||||
|
|||||||
@ -304,11 +304,11 @@ namespace uuids
|
|||||||
name_based_sha1 = 5 // The name-based version specified in RFS 4122 with SHA1 hashing
|
name_based_sha1 = 5 // The name-based version specified in RFS 4122 with SHA1 hashing
|
||||||
};
|
};
|
||||||
|
|
||||||
struct uuid
|
class uuid
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
using value_type = uint8_t;
|
using value_type = uint8_t;
|
||||||
|
|
||||||
public:
|
|
||||||
constexpr uuid() noexcept : data({}) {};
|
constexpr uuid() noexcept : data({}) {};
|
||||||
|
|
||||||
explicit uuid(gsl::span<value_type, 16> bytes)
|
explicit uuid(gsl::span<value_type, 16> bytes)
|
||||||
@ -544,7 +544,7 @@ namespace uuids
|
|||||||
return sstr.str();
|
return sstr.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void swap(uuids::uuid & lhs, uuids::uuid & rhs)
|
inline void swap(uuids::uuid & lhs, uuids::uuid & rhs) noexcept
|
||||||
{
|
{
|
||||||
lhs.swap(rhs);
|
lhs.swap(rhs);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user