Add signature() to cpp_function_base

This commit is contained in:
Jonathan Müller 2017-07-10 19:26:55 +02:00
commit 93d2c58f7f
8 changed files with 112 additions and 22 deletions

View file

@ -94,6 +94,14 @@ namespace cppast
return variadic_;
}
/// \returns The signature of the function,
/// i.e. parameters and cv/ref-qualifiers if a member function.
/// It has the form `(int,char,...) const`.
std::string signature() const
{
return do_get_signature();
}
protected:
/// Builder class for functions.
///
@ -176,6 +184,10 @@ namespace cppast
{
}
protected:
/// \returns The signature, it is called by [*signature()]().
virtual std::string do_get_signature() const;
private:
detail::intrusive_list<cpp_function_parameter> parameters_;
std::unique_ptr<cpp_expression> noexcept_expr_;