I had a problem with the implementation of my container type map. The idea was to save the keys in the tree, and the values in the file.
using pm1_t = lib::PersistentMap <int,int>; pm1_t myMap(); //999 key , 100 value myMap[999] = 100; That is, 999 goes to the avl tree, and then a file is created with the name 999 and the value 100 is stored in it.
The question is how to catch the equating operator in order to write the value to a file.
PS
For example, I have such a code.
class fixed_array { public: typedef int size_type; fixed_array(size_type size) : size_(size) { data_ = new T[size_]; } size_type size() const { return size_; } T& operator[](size_type index) { //assert(index < size_); return data_[index]; } const T& operator[](size_type index) const { assert(index < size_); return data_[index]; } private: T* data_; size_type size_; }; void main() { using pm1_t = fixed_array <int, int>; pm1_t myMap(3); //хотелось как перехватить тут оператор приравнивания myMap[1] = 100; } I can not understand how to intercept the value of 100, and save it to a file immediately.