/** ** \file misc/symbol.cc ** \brief Implementation of misc::symbol. */ #include #include #include namespace misc { symbol::symbol(const std::string& s) : unique(s) {} symbol::symbol(const char* s) : unique(std::string(s)) {} symbol symbol::fresh() { return fresh("a"); } symbol symbol::fresh(const symbol& s) { /// Counter of unique symbols. static unsigned counter_ = 0; std::string str = s.get() + "_" + std::to_string(counter_); ++counter_; return symbol(str); } } // namespace misc