From 777b7490470c9f1328abe8d0f83bedda8f02593d Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Thu, 15 Jun 2023 20:45:27 +0200 Subject: c++, codec-json: Added multi dimensional arrays to json --- src/codec/data.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/codec') 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, encode::Native> { value_.resize(get_full_size()); } + data& at(const std::array& ind){ + return value_.at(this->get_index(ind)); + } + + const data& at(const std::array& ind) const { + return value_.at(this->get_index(ind)); + } + template data& at(Dims... i){ return value_.at(this->get_index({i...})); -- cgit v1.2.3