Doesn't seem to work with implicit conversion from the mtr_moved_t to mtr_t due to ambiguity.
Thankfully the mtr_moved_t type still has its right to exist because it signifies a passed ownership which needs to be taken. The only real problem here is the style of acquiring the pointer from the mtr_moved_t type. This could be solved by just adding a function to it. The downside is that all the code sections need to be fitted to this new behavoir.
// pod copy of the pointer
some_mtr_t a = some_moved_mtr_object.mtr() ;
// move the pointer out
some_mtr_t a = some_moved_mtr_object.move() ;
I think I am ok with it because the mtr_moved_t type really was thought to display the purpose of the passed pointer, which is that the ownership of the passed pointer needs to be taken in our explicit memory management.
Unfortunately, the
mtr_moved_t
andmtr_t
types are not that easily convertable. The compiler again complains about ambiguous callsDoesn't seem to work with implicit conversion from the
mtr_moved_t
tomtr_t
due to ambiguity.Thankfully the
mtr_moved_t
type still has its right to exist because it signifies a passed ownership which needs to be taken. The only real problem here is the style of acquiring the pointer from themtr_moved_t
type. This could be solved by just adding a function to it. The downside is that all the code sections need to be fitted to this new behavoir.I think I am ok with it because the
mtr_moved_t
type really was thought to display the purpose of the passed pointer, which is that the ownership of the passed pointer needs to be taken in our explicit memory management.