-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathcpp_variable_template.hpp
More file actions
42 lines (33 loc) · 1.19 KB
/
cpp_variable_template.hpp
File metadata and controls
42 lines (33 loc) · 1.19 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
// Copyright (C) 2017-2023 Jonathan Müller and cppast contributors
// SPDX-License-Identifier: MIT
#ifndef CPPAST_CPP_VARIABLE_TEMPLATE_HPP_INCLUDED
#define CPPAST_CPP_VARIABLE_TEMPLATE_HPP_INCLUDED
#include <cppast/cpp_template.hpp>
#include <cppast/cpp_variable.hpp>
namespace cppast
{
/// A [cppast::cpp_entity]() modelling a C++ alias template.
class cpp_variable_template final : public cpp_template
{
public:
static cpp_entity_kind kind() noexcept;
/// Builder for [cppast::cpp_variable_template]().
class builder : public basic_builder<cpp_variable_template, cpp_variable>
{
public:
using basic_builder::basic_builder;
};
/// \returns A reference to the type variable that is being templated.
const cpp_variable& variable() const noexcept
{
return static_cast<const cpp_variable&>(*begin());
}
private:
cpp_variable_template(std::unique_ptr<cpp_variable> variable)
: cpp_template(std::unique_ptr<cpp_entity>(variable.release()))
{}
cpp_entity_kind do_get_entity_kind() const noexcept override;
friend basic_builder<cpp_variable_template, cpp_variable>;
};
} // namespace cppast
#endif // CPPAST_CPP_VARIABLE_TEMPLATE_HPP_INCLUDED