summaryrefslogtreecommitdiff
path: root/modules/codec/c++/data.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/codec/c++/data.hpp')
-rw-r--r--modules/codec/c++/data.hpp7
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;