Skip to content

Comments

Refactor pop to use reference_wrapper#708

Merged
wvpm merged 1 commit intomasterfrom
refactor_pop_reference_wrapper
Feb 24, 2026
Merged

Refactor pop to use reference_wrapper#708
wvpm merged 1 commit intomasterfrom
refactor_pop_reference_wrapper

Conversation

@wvpm
Copy link
Contributor

@wvpm wvpm commented Feb 24, 2026

A pop always has a location. Pops must be movable, thus storing ProvinceInstance& isn't an option.
std::reference_wrapper<ProvinceInstance> keeps pops movable whilst avoiding redundant null checks.
Also adds support for std::reference_wrapper<ProvinceInstance> PROPERTY(location);
It generates ProvinceInstance const& get_location() const

@wvpm wvpm force-pushed the refactor_pop_reference_wrapper branch from 2d5ad79 to 12924c9 Compare February 24, 2026 11:07
@wvpm wvpm force-pushed the refactor_pop_reference_wrapper branch from c48f633 to 94fd9bf Compare February 24, 2026 13:38
@wvpm wvpm enabled auto-merge February 24, 2026 13:55
@wvpm wvpm merged commit 84bb30c into master Feb 24, 2026
16 checks passed
@wvpm wvpm deleted the refactor_pop_reference_wrapper branch February 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants