C++ Codes
Algorithms
Algorithm Analysis in C++
Beginners
Code Snippets
Graphics
Data Structures
File Manipulation
Games
Mathematics
Miscellaneous
Visual C++ Library
C++ > Data Structures and Algorithm Analysis in C++ sample source codes
MemoryCell.cpp - MemoryCell class implementation (Fig 1.21)
MemoryCell.cpp - MemoryCell class implementation (Fig 1.21) #include "MemoryCell.h" /** * Construct the MemoryCell with initialValue */ template <class Object> MemoryCell<Object>::MemoryCell( const Object & initialValue ) : storedValue( initialValue ) { } /** * Return the stored value. */ template <class Object> const Object & MemoryCell<Object>::read( ) const { return storedValue; } /** * Store x. */ template <class Object> void MemoryCell<Object>::write( const Object & x ) { storedValue = x; }
Privacy Policy
|
Link to Us
|
Links