summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/concept.hpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-21 17:31:16 -0500
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-21 17:31:16 -0500
commit55f586437b52bda32793a376f8ea5df9fb1b89e2 (patch)
treed1efc540c35a121548478add010dd5363f6fa7b6 /starts/meaning-vm/concept.hpp
parent6e81ffa9f5baabe8d4b16fa927ce423fbe26771e (diff)
downloadstandingwithresilience-55f586437b52bda32793a376f8ea5df9fb1b89e2.tar.gz
standingwithresilience-55f586437b52bda32793a376f8ea5df9fb1b89e2.zip
helpers
Diffstat (limited to 'starts/meaning-vm/concept.hpp')
-rw-r--r--starts/meaning-vm/concept.hpp10
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();