Skip to content

Commit

Permalink
libcore: More flexible applyFlagOperation() template
Browse files Browse the repository at this point in the history
Allow the second argument to be a different type.
  • Loading branch information
skyjake committed Oct 12, 2015
1 parent 8e628e0 commit 68cec34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doomsday/sdk/libcore/include/de/libcore.h
Expand Up @@ -462,8 +462,8 @@ enum FlagOp {
ReplaceFlags = 2 ///< Specified flags become the new set of flags, replacing all previous flags.
};

template <typename FlagsType>
void applyFlagOperation(FlagsType &flags, FlagsType const &newFlags, FlagOp operation) {
template <typename FlagsType, typename FlagsCompatibleType>
void applyFlagOperation(FlagsType &flags, FlagsCompatibleType const &newFlags, FlagOp operation) {
switch(operation) {
case SetFlags: flags |= newFlags; break;
case UnsetFlags: flags &= ~newFlags; break;
Expand Down

0 comments on commit 68cec34

Please sign in to comment.