X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fsymbol.cpp;h=76eb79ee75cf3605279daa7d6d2a8d7a2d587a09;hb=96be7a17790700998e2d071e00ad5c1ffb4a2d3e;hp=4dd0691c648ac435b4ef60cbaf1074f6fed28ff5;hpb=1b8bcb068171ce9d5c8202ae3c76647b65c9a06d;p=ginac.git diff --git a/ginac/symbol.cpp b/ginac/symbol.cpp index 4dd0691c..76eb79ee 100644 --- a/ginac/symbol.cpp +++ b/ginac/symbol.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's symbolic objects. */ /* - * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2018 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,6 @@ #include "symbol.h" #include "lst.h" #include "archive.h" -#include "tostring.h" #include "utils.h" #include "hash_seed.h" #include "inifcns.h" @@ -153,13 +152,19 @@ static const std::string& get_default_TeX_name(const std::string& name); std::string symbol::get_name() const { if (name.empty()) { - std::ostringstream s; - s << "symbol" << serial; - name = s.str(); + name = "symbol" + std::to_string(serial); } return name; } +std::string symbol::get_TeX_name() const +{ + if (TeX_name.empty()) { + return get_default_TeX_name(get_name()); + } + return TeX_name; +} + // protected void symbol::do_print(const print_context & c, unsigned level) const