We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes a container type may have missing semantics in order to be customized as in containers. For example:
max_size()
sol2/include/sol/stack_get_unqualified.hpp
Lines 399 to 402 in 2b0d2fe
value_type
Lines 585 to 587 in 2b0d2fe
Here is a concrete example (actually I encountered a similar case in a library: the containers in the skia library SkSpan, TArray, STArray):
skia
SkSpan
TArray
STArray
template <typename T> class Vector { private: std::vector<T> data; // changed to map public: // Intentionally omitted // using value_type = typename std::vector<T>::value_type; using iterator = typename std::vector<T>::iterator; using size_type = typename std::vector<T>::size_type; using reference = typename std::vector<T>::reference; iterator begin() { return iterator(data.begin()); } iterator end() { return iterator(data.end()); } reference operator[](size_type n) { return data[n]; } };
I suggest deferring such missing traits in the container type to the customization traits sol::usertype_container. Thanks.
sol::usertype_container
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sometimes a container type may have missing semantics in order to be customized as in containers.
For example:
max_size()
will fail to compile.sol2/include/sol/stack_get_unqualified.hpp
Lines 399 to 402 in 2b0d2fe
value_type
will fail to compile.sol2/include/sol/stack_get_unqualified.hpp
Lines 585 to 587 in 2b0d2fe
Here is a concrete example (actually I encountered a similar case in a library: the containers in the
skia
librarySkSpan
,TArray
,STArray
):I suggest deferring such missing traits in the container type to the customization traits
sol::usertype_container
.Thanks.
The text was updated successfully, but these errors were encountered: