ifsteam的move构造函数是否被隐式删除?

Ray*_*ery 12 c++ gcc c++11

我有以下简单的类:

class Source
{
public:
    Source() = default;
    Source(Source const&) = delete;
    Source(Source&&) = default;

    explicit Source(std::string const& fileName)
     : inputStream(fileName), path_(fileName)
    {}

    ~Source() = default;

    auto path() const -> std::string
    {
        return this->path_;
    }

    std::ifstream inputStream;
private:
    std::string path_;
};

auto main(int argc, char* argv[]) -> int
{
    Source source(Source("test.txt"));
    cout << source.path() << "\n";

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

根据cppreference ifstream有一个move构造函数,但是当我尝试编译时MinGW 4.7.2,我得到以下错误:

..\src\main.cpp:32:46:错误:使用已删除的函数'cy :: Source :: Source(cy :: Source &&)'在..\src\main.cpp中包含的文件中:10:0 :source.hpp:28:5:注意:'cy :: Source :: Source(cy :: Source &&)'被隐式删除,因为默认定义不正确:source.hpp:28:5:错误:使用已删除的函数'std :: basic_ifstream :: basic_ifstream(const std :: basic_ifstream&)'c:\ mingw\bin ../ lib/gcc/mingw32/4.7.2/include/c ++/fstream:420:11:注意:隐式删除'std :: basic_ifstream :: basic_ifstream(const std :: basic_ifstream&)',因为默认定义不正确:c:\ mingw\bin ../ lib/gcc/mingw32/4.7.2/include/c ++/fstream:420:11:错误:使用已删除的函数'std :: basic_istream :: basic_istream(const std :: basic_istream&)'

难道我做错了什么?或者cppreference的文档是不准确的?或者GCC 4.7.2有错误?

Ray*_*ery 12

事实证明,GCC的标准库实现还没有实现流类的移动和交换操作.有关gcc标准库中C++ 11功能的当前状态的详细信息,请参见此处.

感谢Jesse Good提供的信息和链接.