diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-12 13:20:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-12 13:20:38 +0200 |
commit | 943f6c3129b351946e81ef08a6a0531f828a7812 (patch) | |
tree | 40444a3d8b145a61631c819464228d2ec645fc33 /libbutl/fdstream.mxx | |
parent | e777ee4ada2281fb207558b6173cfa7b99930caf (diff) |
Add few fdstream constructor overloads
Diffstat (limited to 'libbutl/fdstream.mxx')
-rw-r--r-- | libbutl/fdstream.mxx | 74 |
1 files changed, 50 insertions, 24 deletions
diff --git a/libbutl/fdstream.mxx b/libbutl/fdstream.mxx index a3d9039..49c5dae 100644 --- a/libbutl/fdstream.mxx +++ b/libbutl/fdstream.mxx @@ -442,44 +442,57 @@ LIBBUTL_MODEXPORT namespace butl // Create an unopened object. // explicit - ifdstream (iostate e = badbit | failbit); + ifdstream (iostate = badbit | failbit); explicit ifdstream (auto_fd&&, - iostate e = badbit | failbit, + iostate = badbit | failbit, std::uint64_t pos = 0); ifdstream (auto_fd&&, fdstream_mode m, - iostate e = badbit | failbit, + iostate = badbit | failbit, std::uint64_t pos = 0); explicit ifdstream (const char*, - openmode = in, - iostate e = badbit | failbit); + iostate = badbit | failbit); explicit ifdstream (const std::string&, - openmode = in, - iostate e = badbit | failbit); + iostate = badbit | failbit); explicit ifdstream (const path&, - openmode = in, - iostate e = badbit | failbit); + iostate = badbit | failbit); + + // @@ In some implementations (for example, MSVC), iostate and openmode + // (and/or their respective constants) are not distinct enough which + // causes overload resolution errors. + // + ifdstream (const char*, + openmode, + iostate /*= badbit | failbit*/); + + ifdstream (const std::string&, + openmode, + iostate /*= badbit | failbit*/); + + ifdstream (const path&, + openmode, + iostate /*= badbit | failbit*/); ifdstream (const char*, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ifdstream (const std::string&, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ifdstream (const path&, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ~ifdstream () override; @@ -548,44 +561,57 @@ LIBBUTL_MODEXPORT namespace butl // Create an unopened object. // explicit - ofdstream (iostate e = badbit | failbit); + ofdstream (iostate = badbit | failbit); explicit ofdstream (auto_fd&&, - iostate e = badbit | failbit, + iostate = badbit | failbit, std::uint64_t pos = 0); ofdstream (auto_fd&&, fdstream_mode m, - iostate e = badbit | failbit, + iostate = badbit | failbit, std::uint64_t pos = 0); explicit ofdstream (const char*, - openmode = out, - iostate e = badbit | failbit); + iostate = badbit | failbit); explicit ofdstream (const std::string&, - openmode = out, - iostate e = badbit | failbit); + iostate = badbit | failbit); explicit ofdstream (const path&, - openmode = out, - iostate e = badbit | failbit); + iostate = badbit | failbit); + + // @@ In some implementations (for example, MSVC), iostate and openmode + // (and/or their respective constants) are not distinct enough which + // causes overload resolution errors. + // + ofdstream (const char*, + openmode, + iostate /*= badbit | failbit*/); + + ofdstream (const std::string&, + openmode, + iostate /*= badbit | failbit*/); + + ofdstream (const path&, + openmode, + iostate /*= badbit | failbit*/); ofdstream (const char*, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ofdstream (const std::string&, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ofdstream (const path&, fdopen_mode, - iostate e = badbit | failbit); + iostate = badbit | failbit); ~ofdstream () override; |