From 6b761abbee4361571bd74e3deda9370ad94bd470 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 10 Sep 2024 16:25:03 +0200 Subject: Add referencing with custom types --- modules/codec/c++/data.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules') diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index 5d3e4ee..75c611c 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -696,6 +696,16 @@ public: const data& at(const std::array& ind) const { return value_.at(this->get_flat_index(ind)); } + + template + data& at(data... i) { + return value_.at(this->get_flat_index({i...})); + } + + template + const data& at(data... i) const { + return value_.at(this->get_flat_index({i...})); + } template data& at(Dims... i) { -- cgit v1.2.3