Skip to content

Commit

Permalink
Assigning ComponentWrapper should always mean copying components
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkww committed Oct 30, 2015
1 parent d114c3e commit 12e31c2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions types.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,9 @@ class ComponentWrapper

Type &operator =(const Type &o)
{
myArray = o.myArray;
myIndex = o.myIndex;
myComponent = o.myComponent;

assert(myComponent == StartComponent);
// Assignment should always mean copying components
assert(&myArray != &o.myArray);
return this->operator=<Type>(o);
}

template<typename O>
Expand Down

0 comments on commit 12e31c2

Please sign in to comment.