From 19551e30ed19247e960d0f9da9c621e2e89b8446 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 29 Sep 2020 12:52:50 +1000 Subject: [PATCH] dset: add named erase method --- set/dset.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/set/dset.hpp b/set/dset.hpp index 79b33c00..2c10acab 100644 --- a/set/dset.hpp +++ b/set/dset.hpp @@ -68,7 +68,15 @@ namespace cruft::set { /// /// Items must be in sorted order, and must be a subset of this /// container. - void erase (std::span); + void erase (std::span rhs) + { + *this = *this - rhs; + } + + void erase (ValueT const &val) + { + erase (std::span (&val, 1)); + } /// Tests if the list is a subset of this container. ///