Skip to content

Move STL-like container headers to core/stl/containers#744

Merged
Spartan322 merged 1 commit into
masterfrom
add/stl-like-containers
May 23, 2026
Merged

Move STL-like container headers to core/stl/containers#744
Spartan322 merged 1 commit into
masterfrom
add/stl-like-containers

Conversation

@Spartan322

@Spartan322 Spartan322 commented May 20, 2026

Copy link
Copy Markdown
Member

Includes:

  • CowPtr
  • CowVector
  • FixedVector
  • RingBuffer
  • StackString
  • TypedSpan

Move allocator aware STL-like containers to OpenVic::stl namespace
Includes:

  • CowPtr
  • CowVector
  • FixedVector
  • RingBuffer

Move BasicIterator to core/stl
Move TslHelper.hpp to core/stl and rename to MutableIterator.hpp

Move memory container type aliases to core/memory

Add memory type alias for cow_ptr
Add memory type alias for cow_vector

Move FixedVector from namespace OpenVic::_detail to OpenVic::stl

Add stateful allocator support to FixedVector's constructors

Replace assert in TypedSpan with OV_HARDEN_ASSERT_ACCESS

Move STL-like container unit tests to core/stl/containers

@Spartan322
Spartan322 requested a review from a team as a code owner May 20, 2026 06:05
@Spartan322 Spartan322 added enhancement Issue that describes an improvement to the project topic:codestyle Issue that applies stylistic changes to the module, semantics and mechanics should not change topic:core Issue that applies to core functions, fundamental to the rest of the module labels May 20, 2026
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch 2 times, most recently from 45f5685 to 6fd5c56 Compare May 20, 2026 06:11
Comment thread src/openvic-simulation/core/memory/CowPtr.hpp Outdated
Comment thread src/openvic-simulation/core/memory/FixedVector.hpp
Comment thread src/openvic-simulation/core/memory/RingBuffer.hpp
Comment thread src/openvic-simulation/core/stl/containers/TunableVector.hpp Outdated
Comment thread src/openvic-simulation/core/memory/TunableVector.hpp Outdated
Comment thread src/openvic-simulation/core/portable/ForwardableSpan.hpp
Comment thread src/openvic-simulation/core/stl/containers/CowVector.hpp
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/core/stl/containers/TypedSpan.hpp Outdated
Comment thread src/openvic-simulation/core/stl/containers/TypedSpan.hpp
Comment thread src/openvic-simulation/types/Signal.hpp
Comment thread tests/src/core/stl/containers/FixedVector.cpp

@wvpm wvpm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall a step in the right direction.
Move tunable_vector to a separate PR. It has nothing to do with this.
Besides that, it just need some import fixes.

@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch from 6fd5c56 to b3f4817 Compare May 20, 2026 11:20
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch 2 times, most recently from bdb5122 to 0c289ed Compare May 20, 2026 16:25
@Spartan322
Spartan322 requested a review from wvpm May 20, 2026 16:28
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch from 0c289ed to b2c561e Compare May 20, 2026 16:39
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
wvpm
wvpm previously approved these changes May 20, 2026

@wvpm wvpm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Support constructor tags in FixedVector and this is ready for merge 👍

@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch 2 times, most recently from d4bc84c to db3fe7f Compare May 20, 2026 20:14
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp

@wvpm wvpm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The FixedVector now has a critical bug with size. See comments

@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch 2 times, most recently from f94003a to 069ae75 Compare May 21, 2026 00:48
@Spartan322
Spartan322 requested a review from wvpm May 21, 2026 00:48
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch 2 times, most recently from ecb7ae0 to b8ffe2c Compare May 21, 2026 04:30
Comment thread src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp Outdated
wvpm
wvpm previously approved these changes May 21, 2026
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
Comment thread src/openvic-simulation/core/stl/containers/FixedVector.hpp Outdated
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch from b8ffe2c to 8606610 Compare May 23, 2026 22:37
@Spartan322
Spartan322 requested a review from wvpm May 23, 2026 22:38
Includes:
	- CowPtr
	- CowVector
	- FixedVector
	- RingBuffer
	- StackString
	- TypedSpan

Move allocator aware STL-like containers to `OpenVic::stl` namespace
Includes:
	- CowPtr
	- CowVector
	- FixedVector
	- RingBuffer

Move BasicIterator to `core/stl`
Move TslHelper.hpp to `core/stl` and rename to MutableIterator.hpp

Move memory container type aliases to `core/memory`

Add memory type alias for cow_ptr
Add memory type alias for cow_vector

Move FixedVector from namespace `OpenVic::_detail` to `OpenVic::stl`

Add stateful allocator support to FixedVector's constructors

Replace assert in TypedSpan with `OV_HARDEN_ASSERT_ACCESS`

Move STL-like container unit tests to `core/stl/containers`
@Spartan322
Spartan322 force-pushed the add/stl-like-containers branch from 8606610 to fa0e42f Compare May 23, 2026 23:08
@Spartan322
Spartan322 enabled auto-merge May 23, 2026 23:08
@Spartan322
Spartan322 merged commit 74077cd into master May 23, 2026
16 checks passed
@wvpm
wvpm deleted the add/stl-like-containers branch May 23, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Issue that describes an improvement to the project topic:codestyle Issue that applies stylistic changes to the module, semantics and mechanics should not change topic:core Issue that applies to core functions, fundamental to the rest of the module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants