From [class.copy.assign]:
A user-declared copy assignment operator X::operator=
is a non-static non-template member function of class X
with exactly one parameter of type X
, X&
, const X&
, volatile X&
or const volatile X&
.
and similarly for move:
A user-declared move assignment operator X::operator=
is a non-static non-template member function of class X
with exactly one parameter of type X&&
, const X&&
, volatile X&&
, or const volatile X&&
.
There is no restriction here on the return type. Only on the parameter type. The version of these that the compiler generates returns X&
, but that in no way obligates you to do the same thing.
If you're deleting the assignment operator anyway, returning void
is fine. Note that you do not need to delete both the copy and move assignment operators. If you delete the copy assignment, the move won't be implicitly generated.
Is there any interference in case of inheritance?
No. The implicitly generated assignment operators would just be defined as deleted (and would return X&
, although that's orthogonal). If you declare one, then that's of course up to you to do whatever you want.