I've got an Action
class that looks like this (in its stripped down form):
struct Action {
explicit Action(...some parameters...); // I only use this to construct Action objects
Action(const Action&) = delete; // Don't want copy constructor
Action(Action&&) = delete; // Same for move constructor
}
In some other translation unit, I have tried to do this:
Action action = someMethodForGettingActions(); // The method returns Action objects by rvalue
Visual Studio's Intellisense wants to hang me for this, justifiably. It says it can't access the move constructor. Yet this compiles and runs as expected. What's going on here? Is this some compiler optimization playing mind tricks on me?