Parse template parameters and part of alias template

This commit is contained in:
Jonathan Müller 2017-03-23 09:10:14 +01:00
commit cd4a25e959
14 changed files with 688 additions and 45 deletions

View file

@ -14,6 +14,8 @@ namespace cppast
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>
{

View file

@ -39,6 +39,8 @@ namespace cppast
{
}
basic_builder(basic_builder&&) = default;
/// \effects Adds a parameter.
void add_parameter(std::unique_ptr<cpp_template_parameter> parameter)
{
@ -46,6 +48,12 @@ namespace cppast
.parameters_.push_back(*template_entity, std::move(parameter));
}
/// \returns The not yet finished template.
T& get() const noexcept
{
return *template_entity;
}
/// \effects Registers the template.
/// \returns The finished template.
std::unique_ptr<T> finish(const cpp_entity_index& idx, cpp_entity_id id)

View file

@ -48,6 +48,8 @@ namespace cppast
class cpp_template_type_parameter final : public cpp_template_parameter
{
public:
static cpp_entity_kind kind() noexcept;
/// \returns A newly created and registered template type parameter.
/// \notes The `default_type` may be `nullptr` in which case the parameter has no default.
static std::unique_ptr<cpp_template_type_parameter> build(