@Curin I've just noticed these operators

@Curin I've just noticed these operators:
public static implicit operator Ptr3D(void* ptr) => new((void***)ptr);
public static implicit operator Ptr3D(void** ptr) => new((void***)ptr);
public static implicit operator Ptr3D(void* ptr) => new((void***)ptr);
public static implicit operator Ptr3D(void** ptr) => new((void***)ptr);
this could be a bit prone to misuse. do you remember why they were originally added?
3 Replies
Perksey
Perksey2mo ago
opening thread for this so I can continue rambling
Curin
Curin2mo ago
Mostly completeness. Since ptr types were only meant as output types this really only should be used by us. We either could remove them or make them explicit if it bothers you. I'm not super partial to having them if you really need this type of conversion you can do it manually.
Perksey
Perksey2mo ago
yeah I’m mostly thinking because implicitly interpreting a two dimensional pointer as a three dimensional pointer could be confusing my gut feel is remove given that it’s probably a mistake in any case, but then again given the fact we can do this in the first place could be considered a reason why we should keep it but make it explicit