Edit: I think the most likely use case for what I'm asking about, is when creating a function that receives a tuple of rvalue-references from std::forward_as_tuple()
.
The reason this question came to mind is because I was checking the members of objects passed to constructor initializers to see if they were rvalue-references (I'm open to advice telling me that this is wrong wrong wrong... hopefully followed by a rule of thumb to avoid this in the future, but that's what prompted the question). It occurred to me that, in a slightly different context, I might end up handing an object that has rvalue-reference members to multiple functions (or function objects), that I may or may not control, that may do moves from those members.
template<typename... Args>
void my_func(std::tuple<Args...>&& tup) {
//if tup's members are rvalue references,
//and this function moves guts from tup members, then...
func_i_dont_control(tup);
//what happens here if moves are done on the same members?
another_func_i_dont_control(std::move(tup));
}
I've looked at Use of rvalue reference members?, along with some other discussions of rvalue reference members, but I'm not quite able to definitively sort this out.
I'm not just asking what would happen, but whether this scenario should/could even happen at all, and what key rules to keep in mind when passing around objects containing rvalue-reference members.