Use of rvalue reference members?

后端 未结 4 987
离开以前
离开以前 2021-01-30 06:52

I was wondering what use an rvalue reference member has

class A {
  // ...
  // Is this one useful?
  Foo &&f;
};

Does it have any bene

4条回答
  •  既然无缘
    2021-01-30 07:19

    According to Stephan T. Lavavej, rvalue reference data members have no use.

    [at 31:00] The thing I've seen programmers do when they get hold of rvalue references is that, they start to go a little crazy, because they're so powerful. They start saying "Oh, I'm gonna have rvalue reference data members, I'm gonna have rvalue reference local variables, I'm gonna have rvalue reference return values!" And then they write code like this: [...]

提交回复
热议问题