update ArxContainer to v0.3.8

master
Hideaki Tai 4 years ago
parent 92442d769e
commit 9ab5f0da8f

@ -248,7 +248,7 @@ Please use only sender OR receiver.
## Embedded Libraries ## 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) - [TeensyDirtySTLErrorSolution v0.1.0](https://github.com/hideakitai/TeensyDirtySTLErrorSolution)

@ -444,6 +444,17 @@ namespace arx {
return this->end(); 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<iterator, bool> insert(const Key& key, const T& t) pair<iterator, bool> insert(const Key& key, const T& t)
{ {
bool b {false}; bool b {false};
@ -516,9 +527,9 @@ namespace arx {
return this->end(); 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; if (it != this->end()) return it->second;
insert(::arx::make_pair(key, T())); insert(::arx::make_pair(key, T()));

@ -162,6 +162,7 @@ PRs are welcome!
- [ArduinoOSC](https://github.com/hideakitai/ArduinoOSC) - [ArduinoOSC](https://github.com/hideakitai/ArduinoOSC)
- [ArtNet](https://github.com/hideakitai/ArtNet) - [ArtNet](https://github.com/hideakitai/ArtNet)
- [Tween](https://github.com/hideakitai/Tween) - [Tween](https://github.com/hideakitai/Tween)
- [TimeProfiler](https://github.com/hideakitai/TimeProfiler)
## License ## License

@ -13,7 +13,7 @@
"url": "https://github.com/hideakitai", "url": "https://github.com/hideakitai",
"maintainer": true "maintainer": true
}, },
"version": "0.3.7", "version": "0.3.8",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "arduino",
"platforms": "*" "platforms": "*"

@ -1,5 +1,5 @@
name=ArxContainer name=ArxContainer
version=0.3.7 version=0.3.8
author=hideakitai author=hideakitai
maintainer=hideakitai maintainer=hideakitai
sentence=C++ container-like classes (vector, map, etc.) for Arduino which cannot use STL sentence=C++ container-like classes (vector, map, etc.) for Arduino which cannot use STL

Loading…
Cancel
Save