Closed aconstlink closed 10 months ago
Unfortunately, the idea to pass managed pointers by value or by rref does not work because the compiler will complains about ambiguous overloads.
So we can not do something like this:
void_t some_funk( some_mtr_t ) ... // ... void_t some_funk( some_mtr_rref_t ) ...
Calling some_funk with a managed pointer will fail in compilation.
some_funk
So there need to be some wrapper, so we can solve the moved managed pointer situation into some function and out of some function.
I propose something like this:
template< typename T > class mtr_moved ;
So moved managed pointers could be noted like so
mtr_moved<some_class> some_funk() ... // or void_t some_funk( mtr_moved<some_class> ) ...
That would definitely solve the distinction problem.
Even more conveniently, we could make a movefunction so there is no need to write out mtr_moved<...> in any way:
move
mtr_moved<...>
some_funk( motor::move(some_mtr) ) ;
Unfortunately, the idea to pass managed pointers by value or by rref does not work because the compiler will complains about ambiguous overloads.
So we can not do something like this:
Calling
some_funk
with a managed pointer will fail in compilation.So there need to be some wrapper, so we can solve the moved managed pointer situation into some function and out of some function.
I propose something like this:
So moved managed pointers could be noted like so
That would definitely solve the distinction problem.
Even more conveniently, we could make a
move
function so there is no need to write outmtr_moved<...>
in any way: