// Copyright (C) 2017-2018 Jonathan Müller
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#ifndef CPPAST_CPP_FUNCTION_TEMPLATE_HPP_INCLUDED
#define CPPAST_CPP_FUNCTION_TEMPLATE_HPP_INCLUDED
#include
#include
namespace cppast
{
/// A [cppast::cpp_entity]() modelling a function template.
class cpp_function_template final : public cpp_template
{
public:
static cpp_entity_kind kind() noexcept;
/// Builder for [cppast::cpp_function_template]().
class builder : public basic_builder
{
public:
using basic_builder::basic_builder;
};
/// A reference to the function that is being templated.
const cpp_function_base& function() const noexcept
{
return static_cast(*begin());
}
private:
cpp_function_template(std::unique_ptr func)
: cpp_template(std::unique_ptr(func.release()))
{}
cpp_entity_kind do_get_entity_kind() const noexcept override;
friend basic_builder;
};
/// A [cppast::cpp_entity]() modelling a function template specialization.
class cpp_function_template_specialization final : public cpp_template_specialization
{
public:
static cpp_entity_kind kind() noexcept;
/// Builder for [cppast::cpp_function_template_specialization]().
class builder
: public specialization_builder
{
public:
using specialization_builder::specialization_builder;
private:
using specialization_builder::add_parameter;
};
/// A reference to the function that is being specialized.
const cpp_function_base& function() const noexcept
{
return static_cast(*begin());
}
private:
cpp_function_template_specialization(std::unique_ptr func,
cpp_template_ref primary)
: cpp_template_specialization(std::unique_ptr(func.release()), primary)
{}
cpp_entity_kind do_get_entity_kind() const noexcept override;
friend specialization_builder;
};
} // namespace cppast
#endif // CPPAST_CPP_FUNCTION_TEMPLATE_HPP_INCLUDED