zookeeper-cpp
ZooKeeper Client for C++
|
Base type for creating strong ID types. More...
#include <zk/types.hpp>
Public Types | |
using | value_type = TId |
The representation type of this ID. More... | |
Public Member Functions | |
strong_id () noexcept=default | |
Default construct the ID. More... | |
constexpr | strong_id (value_type value) noexcept |
Construct this instance with the given value. More... | |
constexpr value_type | get () const noexcept |
Get the value of this ID. More... | |
constexpr | operator value_type () noexcept |
Get the value of this ID. More... | |
TReal & | operator++ () |
TReal | operator++ (int) |
TReal & | operator-- () |
TReal | operator-- (int) |
Public Attributes | |
value_type | value |
Underlying value of this ID. More... | |
Base type for creating strong ID types.
These behave similar to a typedef
, but do not allow conversion between different TReal
types, even if they share the same TId
. This makes attempting to use a version
instead of an acl_version
in client::set_acl a compile-time failure instead of throwing a bad_version
at run-time.
TReal | The "real" leaf type of this ID. |
TId | The representation type of this ID. This must be some form of integer and is usually std::int32_t (as in basic_version). |
using zk::strong_id< TReal, TId >::value_type = TId |
|
defaultnoexcept |
Default construct the ID.
This probably leaves value
uninitialized (depending on the constructor of value_type).
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inline |
|
inline |
value_type zk::strong_id< TReal, TId >::value |