Can't bind lvalue to rvalue reference

后端 未结 2 886
野的像风
野的像风 2021-01-12 11:49

I have this C++ test code snippet,

#include 

class A {
        std::vector x;
public:
             


        
2条回答
  •  囚心锁ツ
    2021-01-12 12:06

    Anything that has a name is an lvalue reference. You have to use std::move on parameters to pass them on as rvalue references.

提交回复
热议问题