Boost logo

Boost :

Subject: Re: [boost] [review] Review of Nowide (Unicode) starts today
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2017-06-15 12:32:03


This simple program compiles nicely on Linux+gcc 6.3.0 but fails to
compile on x86_64-w64-mingw (6.3.0, std=c++14):

#include "nowide/fstream.hpp"
int main() {
 auto f = nowide::fstream("toto.log");
 return 0;
}

instead of
auto f=...,
nowide::fstream f("toto.log")
works fine.

The error is:
toto.cpp:4:38: erreur : use of deleted function «
nowide::basic_fstream<char>::basic_fstream(const
nowide::basic_fstream<char>&) »
  auto f = nowide::fstream("toto.log");
                                     ^
In file included from toto.cpp:1:0:
nowide/fstream.hpp:190:11: note : «
nowide::basic_fstream<char>::basic_fstream(const
nowide::basic_fstream<char>&) » is implicitly deleted because the
default definition would be ill-formed:
    class basic_fstream : public std::basic_iostream<CharType,Traits>
          ^~~~~~~~~~~~~
nowide/fstream.hpp:190:11: erreur : use of deleted function «
std::basic_iostream<_CharT, _Traits>::basic_iostream(const
std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits =
std::char_t
raits<char>] »
In file included from
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/iterator:65:0,
                from ./nowide/encoding_utf.hpp:14,
                from ./nowide/convert.hpp:12,
                from nowide/fstream.hpp:13,
                from toto.cpp:1:
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/istream:863:7:
note : declared here
      basic_iostream(const basic_iostream&) = delete;
      ^~~~~~~~~~~~~~
In file included from toto.cpp:1:0:
nowide/fstream.hpp:190:11: erreur : use of deleted function «
std::basic_ios<_CharT, _Traits>::basic_ios(const
std::basic_ios<_CharT, _Traits>&) [with _CharT = char; _Traits =
std::char_traits<char>] »
    class basic_fstream : public std::basic_iostream<CharType,Traits>
          ^~~~~~~~~~~~~
In file included from
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/ios:44:0,
                from
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/ostream:38,
                from
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/iterator:64,
                from ./nowide/encoding_utf.hpp:14,
                from ./nowide/convert.hpp:12,
                from nowide/fstream.hpp:13,
                from toto.cpp:1:
/softs/mingw64-6.3.0/x86_64-w64-mingw32/include/c++/6.3.0/bits/basic_ios.h:475:7:
note : declared here
      basic_ios(const basic_ios&) = delete;
      ^~~~~~~~~
In file included from toto.cpp:1:0:
nowide/fstream.hpp:190:11: erreur : «
nowide::scoped_ptr<T>::scoped_ptr(const nowide::scoped_ptr<T>&) [with
T = nowide::basic_filebuf<char>] » is private within this context
    class basic_fstream : public std::basic_iostream<CharType,Traits>
          ^~~~~~~~~~~~~
In file included from nowide/fstream.hpp:14:0,
                from toto.cpp:1:
./nowide/scoped_ptr.hpp:31:5: note : declared private here
    scoped_ptr(scoped_ptr const &);


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk