Skip to content

Conversation

brendandahl
Copy link
Collaborator

The static assertion here broke some existing code. In the future, I'd like to change this to support a pointer policy to allow references, but for now I need to get this working again for users.


template<internal::EM_INVOKER_KIND Kind, typename Policy, typename Ret, typename... Args>
static Ret internalCall(EM_VAL handle, const char *methodName, Args&&... args) {
static_assert(!std::is_lvalue_reference<Ret>::value,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@RReverser another option is to not allow lvalue references to std::is_arithmetic types.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the issue you said we can allow it only with allow_raw_pointers - can we still do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I hope to do that in a future PR after #24832 lands.

The static assertion here broke some existing code. In the future, I'd like
to change this to support a pointer policy to allow references, but for now
I need to get this working again for users.
@brendandahl brendandahl force-pushed the embind-val-allow-rvalue branch from 57f8491 to 9f33676 Compare September 30, 2025 23:30
@brendandahl brendandahl merged commit 0d529ee into emscripten-core:main Sep 30, 2025
3 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants