Generalize basic_cpp_entity_ref to use predicate
This commit is contained in:
parent
9d60bd2992
commit
21c59afc71
4 changed files with 68 additions and 33 deletions
34
src/cpp_namespace.cpp
Normal file
34
src/cpp_namespace.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2017 Jonathan Müller <jonathanmueller.dev@gmail.com>
|
||||
// This file is subject to the license terms in the LICENSE file
|
||||
// found in the top-level directory of this distribution.
|
||||
|
||||
#include <cppast/cpp_namespace.hpp>
|
||||
|
||||
#include <cppast/cpp_entity_type.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
cpp_entity_type cpp_namespace::do_get_entity_type() const noexcept
|
||||
{
|
||||
return cpp_entity_type::namespace_t;
|
||||
}
|
||||
|
||||
bool detail::cpp_namespace_ref_predicate::operator()(const cpp_entity& e)
|
||||
{
|
||||
return e.type() == cpp_entity_type::namespace_t;
|
||||
}
|
||||
|
||||
cpp_entity_type cpp_namespace_alias::do_get_entity_type() const noexcept
|
||||
{
|
||||
return cpp_entity_type::namespace_alias_t;
|
||||
}
|
||||
|
||||
cpp_entity_type cpp_using_directive::do_get_entity_type() const noexcept
|
||||
{
|
||||
return cpp_entity_type::using_directive_t;
|
||||
}
|
||||
|
||||
cpp_entity_type cpp_using_declaration::do_get_entity_type() const noexcept
|
||||
{
|
||||
return cpp_entity_type::using_declaration_t;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue