sun::semantic_analysis::SemanticContext::LifetimeScopeGuard

sun::semantic_analysis::SemanticContext::LifetimeScopeGuard

class · Source (opens in a new tab)

class sun::semantic_analysis::SemanticContext::LifetimeScopeGuard

Restores lifetime binders and receiver permission on every exit path.

Public Functions

LifetimeScopeGuard

LifetimeScopeGuard(const LifetimeScopeGuard &)=delete

public · function · Source (opens in a new tab)

sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::LifetimeScopeGuard(const LifetimeScopeGuard &)=delete

A lifetime scope has exactly one owner responsible for restoration.

LifetimeScopeGuard(SemanticContext &context, std::optional< bool > allowThis=std::nullopt, bool isolate=false)

public · function · Source (opens in a new tab)

sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::LifetimeScopeGuard(SemanticContext &context, std::optional< bool > allowThis=std::nullopt, bool isolate=false)

Extend the current bindings, or isolate a global initializer from them.

Related: SemanticContext, Extend

operator=

public · function · Source (opens in a new tab)

LifetimeScopeGuard & sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::operator=(const LifetimeScopeGuard &)=delete

Prevent duplicate restoration through assignment.

Related: LifetimeScopeGuard

~LifetimeScopeGuard

public · function · Source (opens in a new tab)

sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::~LifetimeScopeGuard()

Restore the enclosing declaration's bindings, including after errors.

Private Fields

allowThis_

private · variable · Source (opens in a new tab)

bool sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::allowThis_

No documentation comment.

ctx_

private · variable · Source (opens in a new tab)

SemanticContext& sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::ctx_

No documentation comment.

Related: SemanticContext

isolated_

private · variable · Source (opens in a new tab)

bool sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::isolated_

No documentation comment.

mark_

private · variable · Source (opens in a new tab)

size_t sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::mark_

No documentation comment.

savedNames_

private · variable · Source (opens in a new tab)

std::vector<std::string> sun::semantic_analysis::SemanticContext::LifetimeScopeGuard::savedNames_

No documentation comment.