Add is_templated() helper

This commit is contained in:
Jonathan Müller 2017-03-27 21:47:57 +02:00
commit 67f247533c
6 changed files with 26 additions and 4 deletions

View file

@ -8,6 +8,15 @@
using namespace cppast;
bool cppast::is_templated(const cpp_entity& e) noexcept
{
if (!e.parent())
return false;
else if (!is_template(e.parent().value().kind()))
return false;
return e.parent().value().name() == e.name();
}
std::string cppast::full_name(const cpp_entity& e)
{
if (e.name().empty())