Skip to content

Typed fixed vector#737

Open
wvpm wants to merge 1 commit into
masterfrom
typed_fixed_vector
Open

Typed fixed vector#737
wvpm wants to merge 1 commit into
masterfrom
typed_fixed_vector

Conversation

@wvpm
Copy link
Copy Markdown
Contributor

@wvpm wvpm commented May 15, 2026

  1. Support strongly typed indices in FixedVector
  2. Use index as key instead of pointers
  3. Use FixedVector instead of IndexFlatMap when the key isn't required (only index and value)
  4. Improve FixedVector constructors to be explicit and support moving the vector itself (not the values).

@wvpm wvpm force-pushed the typed_fixed_vector branch 5 times, most recently from 4e64a63 to 3564f97 Compare May 16, 2026 20:20
Comment thread src/openvic-simulation/types/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/types/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/types/FixedVector.hpp Outdated
@wvpm wvpm force-pushed the typed_fixed_vector branch from 9de5c5c to 9c5d824 Compare May 17, 2026 11:46
@wvpm wvpm marked this pull request as ready for review May 17, 2026 11:46
@wvpm wvpm requested a review from a team as a code owner May 17, 2026 11:46
@wvpm wvpm enabled auto-merge May 17, 2026 12:01
@wvpm wvpm added enhancement New feature or request topic:codestyle labels May 17, 2026
@wvpm wvpm force-pushed the typed_fixed_vector branch from 9c5d824 to 4934867 Compare May 18, 2026 14:31
Comment thread src/openvic-simulation/utility/Getters.hpp Outdated
Comment thread src/openvic-simulation/utility/Getters.hpp Outdated
forwardable_span<const ReformGroup> reforms;
forwardable_span<const RegimentType> regiment_types;
forwardable_span<const ShipType> ship_types;
memory::vector<RegimentType> const& regiment_types; //can't use forwardable_span due to macos
Copy link
Copy Markdown
Member

@Spartan322 Spartan322 May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats wrong with macOS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would complain during the pipeline about not knowing the size of UnitInstanceBranched<unit_branch_t::LAND>.
So I have to pass it as a vector reference instead of a span :(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is wrong if the forwardable_span isn't supporting forwarding for its particular target case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's due to UnitInstanceBranched being a template.
I gave up on try-compile via pipeline. This is a quick fix.

@wvpm wvpm force-pushed the typed_fixed_vector branch from 4934867 to 7b0c737 Compare May 19, 2026 11:34
@wvpm wvpm force-pushed the typed_fixed_vector branch from 7b0c737 to 78533c4 Compare May 19, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request topic:codestyle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants