using instead of typedef
This commit is contained in:
parent
52587059aa
commit
ca9f84418c
12
P0959.md
12
P0959.md
@ -28,7 +28,9 @@ Revised with feedback from the LWG and the community.
|
|||||||
* Removed typedefs and others container-like parts.
|
* Removed typedefs and others container-like parts.
|
||||||
* Defined the correlation between the internal UUID bytes and the string representation.
|
* Defined the correlation between the internal UUID bytes and the string representation.
|
||||||
* Added UUID layout and byte order specification from the RFC 4122 document.
|
* Added UUID layout and byte order specification from the RFC 4122 document.
|
||||||
# Most functions are constexpr.
|
* Most functions are constexpr.
|
||||||
|
* Replaced typedefs with using statements.
|
||||||
|
|
||||||
|
|
||||||
## II. Motivation
|
## II. Motivation
|
||||||
|
|
||||||
@ -467,7 +469,7 @@ namespace std {
|
|||||||
class basic_uuid_random_generator
|
class basic_uuid_random_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uuid result_type;
|
using result_type = uuid;
|
||||||
|
|
||||||
basic_uuid_random_generator();
|
basic_uuid_random_generator();
|
||||||
explicit basic_uuid_random_generator(UniformRandomNumberGenerator& gen);
|
explicit basic_uuid_random_generator(UniformRandomNumberGenerator& gen);
|
||||||
@ -489,7 +491,7 @@ namespace std {
|
|||||||
class uuid_name_generator
|
class uuid_name_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uuid result_type;
|
using result_type = uuid;
|
||||||
|
|
||||||
explicit uuid_name_generator(uuid const& namespace_uuid) noexcept;
|
explicit uuid_name_generator(uuid const& namespace_uuid) noexcept;
|
||||||
|
|
||||||
@ -506,8 +508,8 @@ namespace std {
|
|||||||
template <>
|
template <>
|
||||||
struct hash<uuid>
|
struct hash<uuid>
|
||||||
{
|
{
|
||||||
typedef uuid argument_type;
|
using argument_type = uuid;
|
||||||
typedef std::size_t result_type;
|
using result_type = std::size_t;
|
||||||
|
|
||||||
result_type operator()(argument_type const &uuid) const;
|
result_type operator()(argument_type const &uuid) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -55,8 +55,8 @@ namespace uuids
|
|||||||
class sha1
|
class sha1
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uint32_t digest32_t[5];
|
using digest32_t = uint32_t[5];
|
||||||
typedef uint8_t digest8_t[20];
|
using digest8_t = uint8_t[20];
|
||||||
|
|
||||||
static constexpr unsigned int block_bytes = 64;
|
static constexpr unsigned int block_bytes = 64;
|
||||||
|
|
||||||
@ -297,12 +297,12 @@ namespace uuids
|
|||||||
{
|
{
|
||||||
struct uuid_const_iterator
|
struct uuid_const_iterator
|
||||||
{
|
{
|
||||||
typedef uuid_const_iterator self_type;
|
using self_type = uuid_const_iterator;
|
||||||
typedef uint8_t value_type;
|
using value_type = uint8_t;
|
||||||
typedef uint8_t const & reference;
|
using reference = uint8_t const &;
|
||||||
typedef uint8_t const * pointer;
|
using pointer = uint8_t const *;
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
using iterator_category = std::random_access_iterator_tag;
|
||||||
typedef ptrdiff_t difference_type;
|
using difference_type = ptrdiff_t;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
pointer ptr = nullptr;
|
pointer ptr = nullptr;
|
||||||
@ -648,7 +648,7 @@ namespace uuids
|
|||||||
class uuid_system_generator
|
class uuid_system_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uuid result_type;
|
using result_type = uuid;
|
||||||
|
|
||||||
uuid operator()()
|
uuid operator()()
|
||||||
{
|
{
|
||||||
@ -744,7 +744,7 @@ namespace uuids
|
|||||||
class basic_uuid_random_generator
|
class basic_uuid_random_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uuid result_type;
|
using result_type = uuid;
|
||||||
|
|
||||||
basic_uuid_random_generator()
|
basic_uuid_random_generator()
|
||||||
:generator(new UniformRandomNumberGenerator)
|
:generator(new UniformRandomNumberGenerator)
|
||||||
@ -785,7 +785,7 @@ namespace uuids
|
|||||||
class uuid_name_generator
|
class uuid_name_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef uuid result_type;
|
using result_type = uuid;
|
||||||
|
|
||||||
explicit uuid_name_generator(uuid const& namespace_uuid) noexcept
|
explicit uuid_name_generator(uuid const& namespace_uuid) noexcept
|
||||||
: nsuuid(namespace_uuid)
|
: nsuuid(namespace_uuid)
|
||||||
@ -860,8 +860,8 @@ namespace std
|
|||||||
template <>
|
template <>
|
||||||
struct hash<uuids::uuid>
|
struct hash<uuids::uuid>
|
||||||
{
|
{
|
||||||
typedef uuids::uuid argument_type;
|
using argument_type = uuids::uuid;
|
||||||
typedef std::size_t result_type;
|
using result_type = std::size_t;
|
||||||
|
|
||||||
result_type operator()(argument_type const &uuid) const
|
result_type operator()(argument_type const &uuid) const
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user