Skip to content

Commit

Permalink
Merge pull request #41 from gundam-organization/main
Browse files Browse the repository at this point in the history
adding toggle options for bool templates
  • Loading branch information
nadrino authored Dec 3, 2024
2 parents c8e5042 + af3ed48 commit 357deec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/GenericToolbox.Wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ namespace GenericToolbox{

// core
void waitUntilEqual(const T& val_) const;
template <typename U = T, typename = std::enable_if_t<std::is_same<U, bool>::value>> void waitUntilEqualThenToggle( bool val_){
waitUntilEqual(val_);
setValue(!val_);
}
template <typename U = T, typename = std::enable_if_t<std::is_same<U, bool>::value>> void toggleThenWaitUntilEqual( bool val_){
setValue(!val_);
waitUntilEqual(val_);
}

// Define operator++ (post-increment) using SFINAE
// Using operator++(int) and not operator++(T) to stay consistent with C++ conventions */
Expand Down

0 comments on commit 357deec

Please sign in to comment.