diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-09 13:25:27 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-09 13:25:27 +0100 |
| commit | cc25c5d6439e5b84ff2a1f87686c974a75ef430c (patch) | |
| tree | 6f9c44f25f2a4210a1a1fed97681d9613dd07cd1 | |
| parent | cd0a54353e804368d98e3765ade8654bb8452088 (diff) | |
| download | forstio-forstio-cc25c5d6439e5b84ff2a1f87686c974a75ef430c.tar.gz | |
Adding better constructors
| -rw-r--r-- | modules/codec/c++/data_math.hpp | 8 | ||||
| -rw-r--r-- | modules/codec/c++/schema.hpp | 4 |
2 files changed, 12 insertions, 0 deletions
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,encode::Native>& inner_value__) requires (sizeof...(Dims) == 0u): + values_{inner_value__} + {} + + data(const data<schema::FixedArray<Inner, Dims...>>& inner_values__) requires (sizeof...(Dims) > 0u): + values_{inner_values__} + {} + data<Inner, encode::Native>& at(const data<schema::FixedArray<schema::UInt64, sizeof...(Dims)>, 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 <typename Schema, string_literal Literal> 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<typename Key, typename Value> struct Map { @@ -114,6 +116,8 @@ class Ref { template<typename Schema> class Ptr { static constexpr string_literal name = "Ptr"; + + using ValueType = Schema; }; struct String { |
