Implements clear functions on Dictionary and List.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5e9ffa0d69
commit
1f882b9596
|
@ -14,6 +14,10 @@ namespace Arbutils::Collections {
|
||||||
explicit Dictionary(size_t capacity) : _map(capacity) {}
|
explicit Dictionary(size_t capacity) : _map(capacity) {}
|
||||||
explicit Dictionary(const std::initializer_list<std::pair<const KeyT, ValueT>>& l) : _map(l){}
|
explicit Dictionary(const std::initializer_list<std::pair<const KeyT, ValueT>>& l) : _map(l){}
|
||||||
|
|
||||||
|
inline void Clear(){
|
||||||
|
_map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
inline void Insert(KeyT key, ValueT value) {
|
inline void Insert(KeyT key, ValueT value) {
|
||||||
auto v = _map.insert({key, value});
|
auto v = _map.insert({key, value});
|
||||||
#ifndef NO_ASSERT
|
#ifndef NO_ASSERT
|
||||||
|
|
|
@ -16,6 +16,10 @@ namespace Arbutils::Collections {
|
||||||
explicit List(size_t capacity) : _vector(capacity) {}
|
explicit List(size_t capacity) : _vector(capacity) {}
|
||||||
List(const std::initializer_list<ValueT>& l) : _vector(l) {}
|
List(const std::initializer_list<ValueT>& l) : _vector(l) {}
|
||||||
|
|
||||||
|
inline void Clear(){
|
||||||
|
_vector.clear();
|
||||||
|
}
|
||||||
|
|
||||||
inline const ValueT& At(size_t index) const {
|
inline const ValueT& At(size_t index) const {
|
||||||
#ifndef NO_ASSERT
|
#ifndef NO_ASSERT
|
||||||
if (index >= _vector.size()) {
|
if (index >= _vector.size()) {
|
||||||
|
|
Loading…
Reference in New Issue