sun::ast::LifetimeParameter
struct · Source (opens in a new tab)
struct sun::ast::LifetimeParameterOne lifetime parameter, as written between the angle brackets with a leading apostrophe, before any type parameters:
<'a> function pick<'a>(...) <'a, T> class Pair<'a, T> { ... }
A lifetime names the stack frame a <'a> lambda's environment or a ref 'a T referent lives in, so two positions in one signature can be declared to share it. Lifetimes are erased before codegen: they never distinguish types, emitted symbols, or generic specializations.
Public Functions
LifetimeParameter
LifetimeParameter(std::string n, sun::support::Position s={})
public · function · Source (opens in a new tab)
sun::ast::LifetimeParameter::LifetimeParameter(std::string n, sun::support::Position s={})Creates a named lifetime parameter retaining its source position.
Related: sun::support::Position
LifetimeParameter()=default
public · function · Source (opens in a new tab)
sun::ast::LifetimeParameter::LifetimeParameter()=defaultCreates a named lifetime parameter retaining its source position.
operator==
public · function · Source (opens in a new tab)
bool sun::ast::LifetimeParameter::operator==(const LifetimeParameter &other) constCompares the stored values for equality.
Related: LifetimeParameter
toString
public · function · Source (opens in a new tab)
std::string sun::ast::LifetimeParameter::toString() const'a — how the parameter reads in source.
Public Fields
name
public · variable · Source (opens in a new tab)
std::string sun::ast::LifetimeParameter::nameNo documentation comment.
span
public · variable · Source (opens in a new tab)
sun::support::Position sun::ast::LifetimeParameter::spanNo documentation comment.
Related: sun::support::Position