#include "helpers.hpp" #include // these concept names are for bootstrapping convenience, // to make hardcoding structures easier. // hence there is just one single list of them concept namesByConcept; std::unordered_map,concept,std::hash> conceptsByName; ref::ref(std::string const & s) { try { ptr = &conceptsByName.at(value(s)); } catch (std::out_of_range) { auto insertion = conceptsByName.emplace(value(s), concept()); ref con = &insertion.first->second; ref nam = const_cast((concept const *)&insertion.first->first); namesByConcept.link(con, nam); ptr = con.ptr; } } value & ref::name() const { return value::of(namesByConcept.get(*this)); } ref::operator const char *() const { return name().c_str(); }