diff --git a/tdutils/td/utils/Enumerator.h b/tdutils/td/utils/Enumerator.h index a3daf137..ba78901b 100644 --- a/tdutils/td/utils/Enumerator.h +++ b/tdutils/td/utils/Enumerator.h @@ -19,9 +19,8 @@ template class Enumerator { public: using Key = int32; - template - Key add(T &&value) { - ValueT v = std::forward(value); + + Key add(ValueT v) { container_->set_zero_value(&v); auto it = set_.lower_bound(Key{0}); container_->set_zero_value(nullptr); @@ -32,6 +31,7 @@ class Enumerator { set_.insert(it, key); return key; } + ValueT &get(Key key) { return container_->get_value(key); }