You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our use case, we are passing const void pointers to build a source PackedImageDesc for use in CPUProcessor::apply. However, PackedImageDesc requires a non-const pointer. I assume this is so that users with non-const data can call getData and modify the result. This makes it dangerous to const_cast our pointer as a caller could then end up inadvertently modifying a const buffer through those calls.
Perhaps there should be a ConstPackedImageDesc? Or is the design to keep the scope of PackedImageDesc tightly around the apply call so that it's unlikely that users can access the getData functions?
The text was updated successfully, but these errors were encountered:
In our use case, we are passing const void pointers to build a source
PackedImageDesc
for use inCPUProcessor::apply
. However,PackedImageDesc
requires a non-const pointer. I assume this is so that users with non-const data can callgetData
and modify the result. This makes it dangerous to const_cast our pointer as a caller could then end up inadvertently modifying a const buffer through those calls.Perhaps there should be a
ConstPackedImageDesc
? Or is the design to keep the scope ofPackedImageDesc
tightly around theapply
call so that it's unlikely that users can access thegetData
functions?The text was updated successfully, but these errors were encountered: