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
set_const
I was using set_const to define enum values. This code works fine (CHAR is an enum constant):
CHAR
mod.set_const("CHAR", CHAR);
This code, however, leads to problems and crashes while precompiling:
const Datatype dt = CHAR; mod.set_const("CHAR", dt);
It seems that this creates something that is a CxxReference{Datatype} on the Julia side, and which internally holds a pointer.
CxxReference{Datatype}
Is that behaviour ever useful? If not, should set_const automatically remove references etc.?
The text was updated successfully, but these errors were encountered:
Confirmed, until I can find a more elegant fix, you can work around this using:
mod.set_const("CHAR", static_cast<Datatype>(dt));
Sorry, something went wrong.
Don't store constants as references
d007d1f
Closes issue JuliaInterop/CxxWrap.jl#374
abad04b
Don't store constants as references (#134)
0f0368d
No branches or pull requests
I was using
set_const
to define enum values. This code works fine (CHAR
is an enum constant):mod.set_const("CHAR", CHAR);
This code, however, leads to problems and crashes while precompiling:
It seems that this creates something that is a
CxxReference{Datatype}
on the Julia side, and which internally holds a pointer.Is that behaviour ever useful? If not, should
set_const
automatically remove references etc.?The text was updated successfully, but these errors were encountered: