1: //MemoryCell.h
3: #ifndef MEMORY_CELL_H
4: #define MEMORY_CELL_H
6: //A class for simulating a memory cell.
7: template <class Object>
8: class MemoryCell
9: {
10: public:
11: explicit MemoryCell(const Object & initialValue = Object());
12: const Object & read() const;
13: void write(const Object& x);
15: private:
16: Object storedValue;
17: };
19: #include "MemoryCell.cpp" //Because separate compilation doesn't work
21: #endif