From 9ab5f0da8fe392b25a8aa2099cd12bb6ae4e6134 Mon Sep 17 00:00:00 2001 From: Hideaki Tai Date: Wed, 22 Jul 2020 15:43:35 +0900 Subject: [PATCH] update ArxContainer to v0.3.8 --- README.md | 2 +- util/ArxContainer/ArxContainer.h | 15 +++++++++++++-- util/ArxContainer/README.md | 1 + util/ArxContainer/library.json | 2 +- util/ArxContainer/library.properties | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 08f42df..4616191 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ Please use only sender OR receiver. ## Embedded Libraries -- [ArxContainer v0.3.7](https://github.com/hideakitai/ArxContainer) +- [ArxContainer v0.3.8](https://github.com/hideakitai/ArxContainer) - [TeensyDirtySTLErrorSolution v0.1.0](https://github.com/hideakitai/TeensyDirtySTLErrorSolution) diff --git a/util/ArxContainer/ArxContainer.h b/util/ArxContainer/ArxContainer.h index cbff0f2..0d1f9ec 100644 --- a/util/ArxContainer/ArxContainer.h +++ b/util/ArxContainer/ArxContainer.h @@ -444,6 +444,17 @@ namespace arx { return this->end(); } + iterator find(const Key& key) + { + for (size_t i = 0; i < this->size(); ++i) + { + iterator it = this->begin() + i; + if (key == it->first) + return it; + } + return this->end(); + } + pair insert(const Key& key, const T& t) { bool b {false}; @@ -516,9 +527,9 @@ namespace arx { return this->end(); } - const T& operator[] (const Key& key) + T& operator[] (const Key& key) { - const_iterator it = find(key); + iterator it = find(key); if (it != this->end()) return it->second; insert(::arx::make_pair(key, T())); diff --git a/util/ArxContainer/README.md b/util/ArxContainer/README.md index 9a8de38..86d7684 100644 --- a/util/ArxContainer/README.md +++ b/util/ArxContainer/README.md @@ -162,6 +162,7 @@ PRs are welcome! - [ArduinoOSC](https://github.com/hideakitai/ArduinoOSC) - [ArtNet](https://github.com/hideakitai/ArtNet) - [Tween](https://github.com/hideakitai/Tween) +- [TimeProfiler](https://github.com/hideakitai/TimeProfiler) ## License diff --git a/util/ArxContainer/library.json b/util/ArxContainer/library.json index 11f7c61..83d940c 100644 --- a/util/ArxContainer/library.json +++ b/util/ArxContainer/library.json @@ -13,7 +13,7 @@ "url": "https://github.com/hideakitai", "maintainer": true }, - "version": "0.3.7", + "version": "0.3.8", "license": "MIT", "frameworks": "arduino", "platforms": "*" diff --git a/util/ArxContainer/library.properties b/util/ArxContainer/library.properties index 21c62ec..1d0fe4d 100644 --- a/util/ArxContainer/library.properties +++ b/util/ArxContainer/library.properties @@ -1,5 +1,5 @@ name=ArxContainer -version=0.3.7 +version=0.3.8 author=hideakitai maintainer=hideakitai sentence=C++ container-like classes (vector, map, etc.) for Arduino which cannot use STL