diff options
author | izetag <izetag@yandex-team.ru> | 2022-02-10 16:49:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:23 +0300 |
commit | 15e99bf7f1c1f5abf1fb12dbe305396757929832 (patch) | |
tree | 900447dbf85608798de0b89288d0dff07e899f16 /library/cpp/yson | |
parent | 1c5482b3f165f677a03848fefcf95d44d5e7a799 (diff) | |
download | ydb-15e99bf7f1c1f5abf1fb12dbe305396757929832.tar.gz |
Restoring authorship annotation for <izetag@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson')
-rw-r--r-- | library/cpp/yson/node/node.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 5f90f95df0..1ba5bb0913 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -128,9 +128,9 @@ public: // Returns true if TNode is neither Null, nor Undefined bool HasValue() const; - template<typename T> - bool IsOfType() const noexcept; - + template<typename T> + bool IsOfType() const noexcept; + // Int64, Uint64, Double, or Bool bool IsArithmetic() const; @@ -161,7 +161,7 @@ public: // integer types cast // makes overflow checks - template<typename T> + template<typename T> T IntCast() const; // integers <-> double <-> string @@ -170,11 +170,11 @@ public: T ConvertTo() const; template<typename T> - T& As(); - - template<typename T> - const T& As() const; - + T& As(); + + template<typename T> + const T& As() const; + static TNode CreateList(); static TNode CreateList(TListType list); static TNode CreateMap(); @@ -294,7 +294,7 @@ inline bool TNode::IsArithmetic() const { return IsInt64() || IsUint64() || IsDouble() || IsBool(); } -template<typename T> +template<typename T> inline T TNode::IntCast() const { if constexpr (std::is_integral<T>::value) { try { @@ -494,20 +494,20 @@ inline T& TNode::ChildAs(size_t index) { } template<typename T> -inline bool TNode::IsOfType() const noexcept { +inline bool TNode::IsOfType() const noexcept { return std::holds_alternative<T>(Value_); -} - -template<typename T> -inline T& TNode::As() { +} + +template<typename T> +inline T& TNode::As() { return std::get<T>(Value_); -} - -template<typename T> -inline const T& TNode::As() const { +} + +template<typename T> +inline const T& TNode::As() const { return std::get<T>(Value_); -} - +} + //////////////////////////////////////////////////////////////////////////////// namespace NNodeCmp { |