diff options
Diffstat (limited to 'starts/meaning-vm/concept.cpp')
-rw-r--r-- | starts/meaning-vm/concept.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/starts/meaning-vm/concept.cpp b/starts/meaning-vm/concept.cpp index c46b058..c064ed4 100644 --- a/starts/meaning-vm/concept.cpp +++ b/starts/meaning-vm/concept.cpp @@ -58,3 +58,17 @@ void concept::unlink(ref type, ref target) } throw std::out_of_range("no such concept link to erase"); } + +void concept::unlink(ref type) +{ + auto ls = links.equal_range(type.ptr); + if (ls.first == ls.second) { + throw std::out_of_range("no such concept link to erase"); + } + auto mid = ls.first; + ++ mid; + if (mid != ls.second) { + throw std::out_of_range("more than one link of type to erase"); + } + links.erase(ls.first); +} |