【问题标题】:Visual studio saying that std has no member move(std::move) . Why is it giving an error?Visual Studio 说 std 没有成员 move(std::move) 。为什么会报错?
【发布时间】:2021-08-17 10:06:54
【问题描述】:

以下是我的代码: 主.cpp

 #include "Integer.h"
    int main() {
           //1st object made
           Integer i1(5);
           Integer i2(std::move(i1));
           return 0;
    }

我有 Visual Studio 2019

【问题讨论】:

  • 你试过包含<utility>吗?
  • 我猜Integer实际上并不管理任何资源,所以std::move在这种情况下与副本相同。

标签: c++ visual-studio c++11 visual-studio-2019


【解决方案1】:

你没有包含 std::move =) 试试#include <utility>

【讨论】:

    猜你喜欢
    • 2014-02-16
    • 1970-01-01
    • 2012-07-28
    • 1970-01-01
    • 2018-02-07
    • 1970-01-01
    • 2020-12-23
    • 2017-06-11
    相关资源
    最近更新 更多