Is std::ofstream movable?

前端 未结 2 1653
离开以前
离开以前 2020-12-11 16:12

I have this map which compiles fine in MSVC10 :

std::map m_logFiles;

But on ubuntu using g++ 4.5 with C++

2条回答
  •  囚心锁ツ
    2020-12-11 16:56

    std::ofstream is movable. This program compiles for me using clang/libc++:

    #include 
    #include 
    #include 
    
    int main()
    {
        std::map m_logFiles;
    }
    

    Reference 27.9.1.11 [ofstream.cons].

提交回复
热议问题