Skip to content

Commit

Permalink
better name
Browse files Browse the repository at this point in the history
  • Loading branch information
veltzer committed Jun 28, 2024
1 parent 6aef3f4 commit 272d56a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/examples/design_patterns/structural/proxy2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@

using namespace std;

template <typename TBD>
template <typename ANYTYPE>
class POP { // Persistent Object Pointer
string oid;
TBD* ptr;
ANYTYPE* ptr;
public:
POP( string id ) { oid = id; ptr = 0; }
~POP() { delete ptr; }
TBD* operator->() {
ANYTYPE* operator->() {
if ( ! ptr)
// simulate the persistence mechanism
ptr = new TBD( oid );
ptr = new ANYTYPE( oid );
return ptr;
}
};
Expand Down

0 comments on commit 272d56a

Please sign in to comment.