Skip to content

Instantly share code, notes, and snippets.

@mutoo
Created May 29, 2013 12:11
Show Gist options
  • Select an option

  • Save mutoo/5669833 to your computer and use it in GitHub Desktop.

Select an option

Save mutoo/5669833 to your computer and use it in GitHub Desktop.
class IntCell
{
public:
explicit IntCell(int initialValue = 0)
:storedValue(initialValue) {}
int read() const {return storedValue;}
void write(int x) {storedValue = x;}
private:
int storedValue;
};
class IntCell
{
public:
IntCell(int initialValue = 0)
:storedValue(initialValue) {}
int read() const {return storedValue;}
void write(int x) {storedValue = x;}
private:
int storedValue;
};
#include <iostream>
#include "IntCell.h"
int main(int argc, const char * argv[])
{
IntCell a;
a = 13;
std::cout << a.read();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment