Skip to content

Conversation

wvpm
Copy link
Contributor

@wvpm wvpm commented Aug 7, 2025

Documentation describing the various C++ types used to store items.
Use this to pick between container types.

@wvpm wvpm added this to the 0.9.0 milestone Aug 7, 2025
@wvpm wvpm added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 7, 2025
Note `vector<bool>` acts as a bit set, see [official documentation](https://en.cppreference.com/w/cpp/container/vector_bool.html).

### cow_vector<T>
Source: src\openvic-simulation\types\CowVector.hpp

Choose a reason for hiding this comment

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

Do you have tests for this type?

	inline constexpr cow_vector<T, Allocator>::size_type cow_vector<T, Allocator>::payload::content_size =
		std::max<size_type>(1ul, (sizeof(payload) - sizeof(array)) / sizeof(T));

would cause the first member of the array to overlap the pointer to the array itself for some sizes of T. If you were trying to have it round up to the largest number of T sufficient to contain the non-T payload data, it would be = (sizeof(payload) + sizeof(T) - 1) / sizeof(T)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants