uuid is class

noexcept on several functions
This commit is contained in:
Marius Bancila 2019-02-20 01:25:17 +02:00
parent dee14f660d
commit e0a781d245
3 changed files with 11 additions and 10 deletions

3
.gitignore vendored
View File

@ -32,4 +32,5 @@
*.app
/build/.gitignore
build
build
/test/CMakeFiles/3.10.0/CompilerIdC/Debug/CompilerIdC.tlog

View File

@ -468,12 +468,12 @@ namespace std {
static bool is_valid_uuid(std::basic_string<CharT, Traits, Allocator> const & str) noexcept;
template<class CharT = char>
static uuid from_string(CharT const * str);
static uuid from_string(CharT const * str) noexcept;
template<class CharT = char,
class Traits = std::char_traits<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:
template <class Elem, class Traits>
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);
@ -485,7 +485,7 @@ namespace std {
```cpp
namespace std {
inline constexpr void swap(uuid & lhs, uuid & rhs);
inline constexpr void swap(uuid & lhs, uuid & rhs) noexcept;
template <class Elem, class Traits>
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,
class Traits = std::char_traits<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;
template<class CharT = char>
static uuid from_string(CharT const * str);
static uuid from_string(CharT const * str) noexcept;
template<class CharT = char,
class Traits = std::char_traits<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:
template <class Elem, class Traits>
friend std::basic_ostream<Elem, Traits> & operator<<(std::basic_ostream<Elem, Traits> &s, uuid const & id);

View File

@ -304,11 +304,11 @@ namespace uuids
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;
public:
constexpr uuid() noexcept : data({}) {};
explicit uuid(gsl::span<value_type, 16> bytes)
@ -544,7 +544,7 @@ namespace uuids
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);
}