================ @@ -0,0 +1,35 @@ + +#ifndef _SIM_MAP +#define _SIM_MAP + +#pragma clang system_header +#include "sim_stl_pair" + +namespace std { + +template <typename Key, typename Value> +class map { + public: + using value_type = pair<Key, Value>; + map(); + map(initializer_list<pair<Key, Value>> initList); + value_type& operator[](const Key& key); + value_type& operator[](Key&& key); + class iterator { + public: + iterator(Key *key): ptr(key) {} + iterator& operator++() { ++ptr; return *this; } + bool operator!=(const iterator &other) const { return ptr != other.ptr; } + const Key &operator*() const { return *ptr; } + private: + Key *ptr; + }; + public: ---------------- 5chmidti wrote:
Nit: weird indentation + not needed `public` in ln 27 https://github.com/llvm/llvm-project/pull/110471 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits