diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-22 14:04:10 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-01-22 14:04:10 +0100 |
| commit | 60fde9fa4770d057be6249a040b96863177cd166 (patch) | |
| tree | 4080b477e12de563509da7853ceff4d441aa7ae6 /modules/codec/c++ | |
| parent | a4d636ffc2e2a252a7879121c833f0f00c9a5ade (diff) | |
| download | forstio-forstio-60fde9fa4770d057be6249a040b96863177cd166.tar.gz | |
Adding flat_data return
Diffstat (limited to 'modules/codec/c++')
| -rw-r--r-- | modules/codec/c++/data.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index 4786af1..3122b4b 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -369,6 +369,13 @@ public: static constexpr data<schema::UInt64> flat_dims() { return {ct_multiply<uint64_t, D...>::value}; } + + constexpr data<T,encode::Native>* flat_data() { + if constexpr (flat_dims() == 0u) { + return nullptr; + } + return &value_[0u]; + } private: constexpr uint64_t get_flat_index(const data<schema::FixedArray<schema::UInt64, sizeof...(D)>>& i) const { uint64_t s = 0; |
