Add cpp_template_template_parameter
This commit is contained in:
parent
535b088123
commit
edb132981a
7 changed files with 153 additions and 3 deletions
|
|
@ -64,6 +64,8 @@ const char* cppast::to_string(cpp_entity_kind kind) noexcept
|
|||
return "template type parameter";
|
||||
case cpp_entity_kind::non_type_template_parameter_t:
|
||||
return "non type template parameter";
|
||||
case cpp_entity_kind::template_template_parameter_t:
|
||||
return "template template parameter";
|
||||
|
||||
case cpp_entity_kind::alias_template_t:
|
||||
return "alias template";
|
||||
|
|
@ -104,6 +106,7 @@ bool cppast::is_type(cpp_entity_kind kind) noexcept
|
|||
case cpp_entity_kind::destructor_t:
|
||||
case cpp_entity_kind::template_type_parameter_t:
|
||||
case cpp_entity_kind::non_type_template_parameter_t:
|
||||
case cpp_entity_kind::template_template_parameter_t:
|
||||
case cpp_entity_kind::alias_template_t:
|
||||
case cpp_entity_kind::count:
|
||||
break;
|
||||
|
|
@ -111,3 +114,41 @@ bool cppast::is_type(cpp_entity_kind kind) noexcept
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cppast::is_template(cpp_entity_kind kind) noexcept
|
||||
{
|
||||
switch (kind)
|
||||
{
|
||||
case cpp_entity_kind::alias_template_t:
|
||||
return true;
|
||||
|
||||
case cpp_entity_kind::file_t:
|
||||
case cpp_entity_kind::language_linkage_t:
|
||||
case cpp_entity_kind::namespace_t:
|
||||
case cpp_entity_kind::namespace_alias_t:
|
||||
case cpp_entity_kind::using_directive_t:
|
||||
case cpp_entity_kind::using_declaration_t:
|
||||
case cpp_entity_kind::type_alias_t:
|
||||
case cpp_entity_kind::enum_t:
|
||||
case cpp_entity_kind::enum_value_t:
|
||||
case cpp_entity_kind::class_t:
|
||||
case cpp_entity_kind::access_specifier_t:
|
||||
case cpp_entity_kind::base_class_t:
|
||||
case cpp_entity_kind::variable_t:
|
||||
case cpp_entity_kind::member_variable_t:
|
||||
case cpp_entity_kind::bitfield_t:
|
||||
case cpp_entity_kind::function_parameter_t:
|
||||
case cpp_entity_kind::function_t:
|
||||
case cpp_entity_kind::member_function_t:
|
||||
case cpp_entity_kind::conversion_op_t:
|
||||
case cpp_entity_kind::constructor_t:
|
||||
case cpp_entity_kind::destructor_t:
|
||||
case cpp_entity_kind::template_type_parameter_t:
|
||||
case cpp_entity_kind::non_type_template_parameter_t:
|
||||
case cpp_entity_kind::template_template_parameter_t:
|
||||
case cpp_entity_kind::count:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
// found in the top-level directory of this distribution.
|
||||
|
||||
#include <cppast/cpp_template_parameter.hpp>
|
||||
|
||||
#include <cppast/cpp_entity_kind.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
|
@ -55,3 +56,13 @@ cpp_entity_kind cpp_non_type_template_parameter::do_get_entity_kind() const noex
|
|||
{
|
||||
return cpp_entity_kind::non_type_template_parameter_t;
|
||||
}
|
||||
|
||||
bool detail::cpp_template_ref_predicate::operator()(const cpp_entity& e)
|
||||
{
|
||||
return is_template(e.kind());
|
||||
}
|
||||
|
||||
cpp_entity_kind cpp_template_template_parameter::do_get_entity_kind() const noexcept
|
||||
{
|
||||
return cpp_entity_kind::template_template_parameter_t;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ bool cppast::is_valid(const cpp_type& type) noexcept
|
|||
|
||||
case cpp_type_kind::builtin:
|
||||
case cpp_type_kind::user_defined:
|
||||
case cpp_type_kind::template_parameter:
|
||||
case cpp_type_kind::unexposed:
|
||||
// no further check required/possible
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <cppast/cpp_language_linkage.hpp>
|
||||
#include <cppast/cpp_member_function.hpp>
|
||||
#include <cppast/cpp_namespace.hpp>
|
||||
#include <cppast/cpp_template_parameter.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
|
|
@ -58,6 +59,8 @@ bool detail::visit(const cpp_entity& e, detail::visitor_callback_t cb, void* fun
|
|||
return handle_container<cpp_conversion_op>(e, cb, functor);
|
||||
case cpp_entity_kind::constructor_t:
|
||||
return handle_container<cpp_constructor>(e, cb, functor);
|
||||
case cpp_entity_kind::template_template_parameter_t:
|
||||
return handle_container<cpp_template_template_parameter>(e, cb, functor);
|
||||
case cpp_entity_kind::alias_template_t:
|
||||
return handle_container<cpp_alias_template>(e, cb, functor);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue