Skip to content

Commit

Permalink
hide copy/assignment operators for base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
webcoyote committed Sep 10, 2012
1 parent 9e59bf8 commit c545721
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Base/Hash.h
Expand Up @@ -163,6 +163,10 @@ class THash {
THash (unsigned rows, size_t offset);
TLink<T> * GetLinkFromNode (const T * node) const;
template<class T, class TKey, size_t offset> friend class THashDeclare;

// Hide copy-constructor and assignment operator
THash (const THash &);
THash & operator= (const THash &);
};

//=============================================================================
Expand Down
16 changes: 8 additions & 8 deletions Base/List.h
Expand Up @@ -73,14 +73,6 @@
* O'Brien in storm.dll for Diablo in 1995, and again at ArenaNet
* for Guild Wars.
*
* I remember being seriously impressed when I read the code.
* Sadly, his code, which was initially used in Starcraft, was
* discarded by another programmer to make writing save-game
* files a bit easier. This was a decision that resulted in me
* fixing vast numbers of linked-list bugs written by other
* programmers, I kid you not. Do NOT use regular linked lists
* unless you like to track down freed-memory deref bugs.
*
***/


Expand Down Expand Up @@ -143,6 +135,10 @@ class TLink {
T * m_nextNode; // pointer to the next >object<
TLink<T> * m_prevLink; // pointer to the previous >link field<
void RemoveFromList ();

// Hide copy-constructor and assignment operator
TLink (const TLink &);
TLink & operator= (const TLink &);
};

//=============================================================================
Expand Down Expand Up @@ -312,6 +308,10 @@ class TList {
TList (size_t offset);
TLink<T> * GetLinkFromNode (const T * node) const;
template<class T, size_t offset> friend class TListDeclare;

// Hide copy-constructor and assignment operator
TList (const TList &);
TList & operator= (const TList &);
};

//=============================================================================
Expand Down
4 changes: 4 additions & 0 deletions Base/Sync.h
Expand Up @@ -18,6 +18,10 @@ class CCritSect {
private:
CRITICAL_SECTION m_crit;

// Hide copy-constructor and assignment operator
CCritSect (const CCritSect &);
CCritSect & operator= (const CCritSect &);

public:
CCritSect ();
~CCritSect ();
Expand Down

0 comments on commit c545721

Please sign in to comment.