45 lines · plain
1 2#ifndef _SIM_SET3#define _SIM_SET4 5#pragma clang system_header6#include "sim_initializer_list"7 8namespace std {9 10template< class T = void >11struct less;12 13template< class T >14struct allocator;15 16template< class Key >17struct hash;18 19template<20 class Key,21 class Compare = std::less<Key>,22 class Alloc = std::allocator<Key>23> class set {24 public:25 set(initializer_list<Key> __list) {}26 27 class iterator {28 public:29 iterator(Key *key): ptr(key) {}30 iterator& operator++() { ++ptr; return *this; }31 bool operator!=(const iterator &other) const { return ptr != other.ptr; }32 const Key &operator*() const { return *ptr; }33 private:34 Key *ptr;35 };36 37 Key *val;38 iterator begin() const { return iterator(val); }39 iterator end() const { return iterator(val + 1); }40};41 42} // namespace std43 44#endif // _SIM_SET45