sun::semantic_analysis::SemanticContext::ScopeSwitchGuard

sun::semantic_analysis::SemanticContext::ScopeSwitchGuard

struct · Source (opens in a new tab)

struct sun::semantic_analysis::SemanticContext::ScopeSwitchGuard

Make target the current scope for the enclosed block (restored on exit, including by exception).

Generic instantiation uses it to analyze a template's body in the scope the template was declared in.

Public Functions

ScopeSwitchGuard

ScopeSwitchGuard(const ScopeSwitchGuard &)=delete

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

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

Temporarily switches semantic lookup to another scope.

ScopeSwitchGuard(SemanticContext &c, SemanticScope *target)

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

sun::semantic_analysis::SemanticContext::ScopeSwitchGuard::ScopeSwitchGuard(SemanticContext &c, SemanticScope *target)

Temporarily switches semantic lookup to another scope.

Related: SemanticContext, SemanticScope

operator=

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

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

Disallows assignment so ownership and object identity cannot be duplicated.

Related: ScopeSwitchGuard

~ScopeSwitchGuard

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

sun::semantic_analysis::SemanticContext::ScopeSwitchGuard::~ScopeSwitchGuard()

Restores the semantic scope active before the guard was created.

Public Fields

ctx

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

SemanticContext& sun::semantic_analysis::SemanticContext::ScopeSwitchGuard::ctx

No documentation comment.

Related: SemanticContext

saved

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

SemanticScope* sun::semantic_analysis::SemanticContext::ScopeSwitchGuard::saved

No documentation comment.

Related: SemanticScope