Skip to content

Commit

Permalink
Removing swap() operation on TimerBuilder instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel AINS committed Jul 31, 2020
1 parent 004ebf6 commit 3e6e73f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/spi/TimerBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,3 @@ std::unique_ptr<ITimer> TimerBuilder::create() const {
return std::unique_ptr<ITimer>(new NSSPI::Timer()); //NOSONAR
#endif // #ifdef USE_CPPTHREADS
}

/**
* This method is a friend of NSSPI::TimerBuilder class
**/
void swap(NSSPI::TimerBuilder& first, NSSPI::TimerBuilder& second) { /* nothrow */
using std::swap; // Enable ADL

#ifdef USE_RARITAN
/* We whould use swap() here to be exception safe but pp::Selector does not implement the swap() method */
/* Because we are dealing with references, there is no risk of exception during the following 3 lines, which is what we must ensure in this swap() method */
pp::Selector& temp = first.eventSelector;
first.eventSelector = second.eventSelector;
second.eventSelector = temp;
#endif
/* Once we have swapped the members of the two instances... the two instances have actually been swapped */
}

0 comments on commit 3e6e73f

Please sign in to comment.