forked from TillHeinzel/pipes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clear primaries recursively on entry to connectsecondary
- Loading branch information
1 parent
f77a0ae
commit 2effd9a
Showing
2 changed files
with
29 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "pipes/detail/core/Node.hpp" | ||
|
||
namespace tillh | ||
{ | ||
namespace pipes | ||
{ | ||
template<class T> | ||
decltype(auto) clearPrimary(T&& t) | ||
{ | ||
return FWD(t); | ||
} | ||
|
||
inline auto clearPrimary(PrimaryOpenConnectionPlaceHolder) | ||
{ | ||
return OpenConnectionPlaceHolder(); | ||
} | ||
|
||
template<class Op, class Connections> | ||
auto clearPrimary(Node<Op, Connections>&& node) | ||
{ | ||
return apply_last(std::move(node), [](auto&& connection) {return clearPrimary(FWD(connection)); }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters