From cc25c5d6439e5b84ff2a1f87686c974a75ef430c Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 9 Feb 2026 13:25:27 +0100 Subject: Adding better constructors --- modules/codec/c++/data_math.hpp | 8 ++++++++ modules/codec/c++/schema.hpp | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'modules/codec') diff --git a/modules/codec/c++/data_math.hpp b/modules/codec/c++/data_math.hpp index 86336ad..3c55e37 100644 --- a/modules/codec/c++/data_math.hpp +++ b/modules/codec/c++/data_math.hpp @@ -83,6 +83,14 @@ public: */ data() = default; + data(const data& inner_value__) requires (sizeof...(Dims) == 0u): + values_{inner_value__} + {} + + data(const data>& inner_values__) requires (sizeof...(Dims) > 0u): + values_{inner_values__} + {} + data& at(const data, encode::Native>& index){ return values_.at(index); } diff --git a/modules/codec/c++/schema.hpp b/modules/codec/c++/schema.hpp index decc027..018cb41 100644 --- a/modules/codec/c++/schema.hpp +++ b/modules/codec/c++/schema.hpp @@ -31,7 +31,9 @@ template struct Member { static constexpr string_literal name = "Member"; using ValueType = Schema; + // To be deprecated static constexpr string_literal KeyLiteral = Literal; + static constexpr string_literal Key = Literal; }; template struct Map { @@ -114,6 +116,8 @@ class Ref { template class Ptr { static constexpr string_literal name = "Ptr"; + + using ValueType = Schema; }; struct String { -- cgit v1.2.3