This question may be sound stupid. I just want to make sure. And maybe that someone point me where this described in standard.
We cannot have rvalue referenced objects inside lvalue. Right?
struct A{int value;};
struct B{
B(A &&value) : a(std::forward<A>(value)){}
A&& a;
};
int main()
{
// allowed
B(A()).a;
// error
B b(A());
b.a;
return 0;
}