create_at with uvalue parameters #124
-
How would i go about calling |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi! It depends a lot on what you want to get in the end and what exactly is stored in this 'uvalue' on the memory of which you want to call a constructor. I would not recommend getting involved with this slippery topic and just recreate the 'uvalue' using the common 'create' function. But if you really want to get UB or something worse, 'uvalue' has a 'get_data' method that will return a pointer to the raw data. |
Beta Was this translation helpful? Give feedback.
The main nuance that should be taken into account with overloaded methods and constructors is that the library does not support the correct determination of the required overload based on the parameters passed. In this regard, the library will simply try to call available constructors one by one until it succeeds.
You can get a suitable constructor using the
get_constructor_with
method which will try to find a constructor with the required parameters (without conversion), or just callcreate
to try to call them one by one. It's up to you.https://gcc.godbolt.org/z/v5sEd585T