-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathcpp_type_alias.cpp
33 lines (26 loc) · 1.09 KB
/
cpp_type_alias.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2017-2023 Jonathan Müller and cppast contributors
// SPDX-License-Identifier: MIT
#include <cppast/cpp_type_alias.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
cpp_entity_kind cpp_type_alias::kind() noexcept
{
return cpp_entity_kind::type_alias_t;
}
std::unique_ptr<cpp_type_alias> cpp_type_alias::build(const cpp_entity_index& idx, cpp_entity_id id,
std::string name,
std::unique_ptr<cpp_type> type)
{
auto result = build(std::move(name), std::move(type));
idx.register_forward_declaration(std::move(id), type_safe::cref(*result)); // not a definition
return result;
}
std::unique_ptr<cpp_type_alias> cpp_type_alias::build(std::string name,
std::unique_ptr<cpp_type> type)
{
return std::unique_ptr<cpp_type_alias>(new cpp_type_alias(std::move(name), std::move(type)));
}
cpp_entity_kind cpp_type_alias::do_get_entity_kind() const noexcept
{
return kind();
}