diff options
Diffstat (limited to 'starts/meaning-vm/concept.hpp')
-rw-r--r-- | starts/meaning-vm/concept.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 <typename T> 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<std::string> & 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<ref,ref,std::less<concept*>> links; + std::multimap<ref,ref> links; using array = std::vector<ref>; ref id(); |