From 55f586437b52bda32793a376f8ea5df9fb1b89e2 Mon Sep 17 00:00:00 2001 From: olpc user Date: Thu, 21 Nov 2019 17:31:16 -0500 Subject: helpers --- starts/meaning-vm/concept.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'starts/meaning-vm/concept.hpp') diff --git a/starts/meaning-vm/concept.hpp b/starts/meaning-vm/concept.hpp index ce76f5d..a2dcc2c 100644 --- a/starts/meaning-vm/concept.hpp +++ b/starts/meaning-vm/concept.hpp @@ -11,12 +11,14 @@ template struct value; struct ref { ref(concept *p) : ptr(p) { } - operator concept*() const { return ptr; } + concept* operator->() { return ptr; } + bool operator<(ref const & other) const { return ptr < other.ptr; } // helper names - ref(std::string); - operator std::string(); + ref(std::string const &); ref(char const * str) : ref(std::string(str)) { } + value & name() const; + operator const char *() const; concept * ptr; }; @@ -24,7 +26,7 @@ struct ref struct concept { // a concept is made of concept-typed links to other concepts - std::multimap> links; + std::multimap links; using array = std::vector; ref id(); -- cgit v1.2.3