OpenTrespasser / JurassicParkTrespasser

A git-based fork of the Jurassic Park: Trespasser source code.
98 stars 24 forks source link

CSetHelper copy-constructor and copy-assignment operator #49

Closed meekee7 closed 4 years ago

meekee7 commented 4 years ago

The CSet class manages bitfields. It has an [] operator which gives write access to a specific bit wrapped in a CSetHelper. A copy-constructor and a copy-assignment operator are added to CSetHelper. The new copy-assignment operator wraps the existing one. This is required for CSetHelper assignments where the rhs expression is also a CSetHelper, like this: CSet<int> set; set[4] = set[5];

Works as probably intended in a standalone program. We should take a mental note to add a unit test for this if we ever integrate a unit test framework.