forked from standardese/cppast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp_alias_template.hpp
More file actions
43 lines (34 loc) · 1.27 KB
/
Copy pathcpp_alias_template.hpp
File metadata and controls
43 lines (34 loc) · 1.27 KB
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
34
35
36
37
38
39
40
41
42
43
// Copyright (C) 2017-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#ifndef CPPAST_CPP_ALIAS_TEMPLATE_HPP_INCLUDED
#define CPPAST_CPP_ALIAS_TEMPLATE_HPP_INCLUDED
#include <cppast/cpp_template.hpp>
#include <cppast/cpp_type_alias.hpp>
namespace cppast
{
/// A [cppast::cpp_entity]() modelling a C++ alias template.
class cpp_alias_template final : public cpp_template
{
public:
static cpp_entity_kind kind() noexcept;
/// Builder for [cppast::cpp_alias_template]().
class builder : public basic_builder<cpp_alias_template, cpp_type_alias>
{
public:
using basic_builder::basic_builder;
};
/// \returns A reference to the type alias that is being templated.
const cpp_type_alias& type_alias() const noexcept
{
return static_cast<const cpp_type_alias&>(*begin());
}
private:
cpp_alias_template(std::unique_ptr<cpp_type_alias> alias)
: cpp_template(std::unique_ptr<cpp_entity>(alias.release()))
{}
cpp_entity_kind do_get_entity_kind() const noexcept override;
friend basic_builder<cpp_alias_template, cpp_type_alias>;
};
} // namespace cppast
#endif // CPPAST_CPP_ALIAS_TEMPLATE_HPP_INCLUDED