Overloading the C++ indexing subscript operator [] in a manner that allows for responses to updates

后端 未结 6 1207
我在风中等你
我在风中等你 2020-12-08 10:32

Consider the task of writing an indexable class which automatically synchronizes its state with some external data-store (e.g. a file). In order to do this the class would n

6条回答
  •  轮回少年
    2020-12-08 11:13

    Return a proxy object which will have:

    • operator=(Type const &) overloaded for writes
    • operator Type() for reads

提交回复
热议问题