#include <StrMod/LocalCopy.h>
Public Methods | |
| LocalCopy (T &classvar) | |
| Constructs a local copy of a member or global variable. | |
| ~LocalCopy () | |
| Stores the local copy back to original member or global variable referenced by classvar in the constructor. | |
| operator T & () | |
| Trying to make this stand in for the variable as much as possible. | |
| operator const T & () const | |
| Trying to make this stand in for the variable as much as possible. | |
| const T & | operator= (const T &b) |
| Trying to make this stand in for the variable as much as possible. | |
Public Attributes | |
| T | local |
| Yes, this is supposed to be public. | |
This will make a local copy of a member variable and store the value of that copy back into the member variable when the local copy is destroyed. This is useful for a member variable you know will only be altered by the function across an entire call, despite other functions being called. When other functions are called, the compiler's CSE throws out member variables, as those variables may concievably be altered by the function call.
Definition at line 46 of file LocalCopy.h.
|
||||||||||
|
Constructs a local copy of a member or global variable.
Definition at line 51 of file LocalCopy.h. |
1.3-rc1