Skip to content

Commit

Permalink
Add support for removing shapes from WF specifications (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasC authored Sep 26, 2024
1 parent 02fcf57 commit 58d4807
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions include/trieste/wf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,30 @@ namespace trieste
wf.append(shape2);
return wf;
}

inline Wellformed operator-(const Wellformed& wf, const Token& token) {
Wellformed wf2;
wf2.shapes.insert(wf.shapes.begin(), wf.shapes.end());
wf2.shapes.erase(token);
return wf2;
}

inline Wellformed operator-(const Wellformed& wf, Token&& token) {
Wellformed wf2;
wf2.shapes.insert(wf.shapes.begin(), wf.shapes.end());
wf2.shapes.erase(token);
return wf2;
}

inline Wellformed operator-(Wellformed&& wf, const Token& token) {
wf.shapes.erase(token);
return std::move(wf);
}

inline Wellformed operator-(Wellformed&& wf, Token&& token) {
wf.shapes.erase(token);
return std::move(wf);
}
}

namespace detail
Expand Down

0 comments on commit 58d4807

Please sign in to comment.