diff options
author | Claudius Holeksa <mail@keldu.de> | 2023-06-15 20:45:27 +0200 |
---|---|---|
committer | Claudius Holeksa <mail@keldu.de> | 2023-06-15 20:45:27 +0200 |
commit | 777b7490470c9f1328abe8d0f83bedda8f02593d (patch) | |
tree | cd0704eeca067fa0d3ef7370c308883a98e5014d /src/codec | |
parent | 4260ffa31e58129ad6822eccce8a81ab750bd8b7 (diff) |
c++, codec-json: Added multi dimensional arrays to json
Diffstat (limited to 'src/codec')
-rw-r--r-- | src/codec/data.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/codec/data.h b/src/codec/data.h index 7ed672b..5cb1267 100644 --- a/src/codec/data.h +++ b/src/codec/data.h @@ -207,6 +207,14 @@ class data<schema::Array<T,Dim>, encode::Native> { value_.resize(get_full_size()); } + data<T, encode::Native>& at(const std::array<std::size_t, Dim>& ind){ + return value_.at(this->get_index(ind)); + } + + const data<T, encode::Native>& at(const std::array<std::size_t, Dim>& ind) const { + return value_.at(this->get_index(ind)); + } + template<std::integral... Dims> data<T, encode::Native>& at(Dims... i){ return value_.at(this->get_index({i...})); |