[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] [io]fstream move ctors
From: |
Greg Chicares |
Subject: |
[lmi] [io]fstream move ctors |
Date: |
Fri, 30 Apr 2021 20:11:37 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 |
Vadim--Please help me understand why clang considers the [io]fstream
move ctors to be deleted (cf. the [squashed] commit below). C++20
(N4861) [ifstream] says:
// 29.9.3.1, constructors
basic_ifstream(basic_ifstream&& rhs);
I assume that it wouldn't be mentioned there if it were deleted;
otherwise, clang would issue a warning for the specification in the
standard itself.
Isn't that the "corresponding base class" of our own fs::ifstream?
commit b59e479bf1c00da63e4ce49b939e97e86c2417c6
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Date: 2021-02-26T16:37:56+00:00
Delete fs::ifstream and ofstream move ctors
These ctors don't exist because they're deleted in the corresponding
base classes, and explicitly defaulting them is misleading (because it
might lead one to believe that they are available, when this is not the
case) and results in -Wdefaulted-function-deleted from clang.
[...]
ifstream(ifstream const&) = delete;
- ifstream(ifstream&&) = default;
+ ifstream(ifstream&&) = delete;
- [lmi] [io]fstream move ctors,
Greg Chicares <=