From f625e90a0721483f7f44b94b9bb57cc9d59565e8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 10 Feb 2017 11:48:58 -0500 Subject: Added negative filter conversions to objects --- lib/notion.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/notion.h') diff --git a/lib/notion.h b/lib/notion.h index 69f5cef..5388e17 100644 --- a/lib/notion.h +++ b/lib/notion.h @@ -119,9 +119,24 @@ namespace verbly { operator filter() const { + if (!valid_) + { + throw std::domain_error("Bad access to uninitialized notion"); + } + return (id == id_); } + filter operator!() const + { + if (!valid_) + { + throw std::domain_error("Bad access to uninitialized notion"); + } + + return (id != id_); + } + // Relationships with other objects static const field words; -- cgit 1.4.1