Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.8.0
-
None
-
Windows 10 64, MSVC 2015, Qt 5.8.0.
Description
Dear friends. First of all thank you for your great job.
Now. This code compiles fine with std::vector:
struct A { explicit A(int) {} A(const A&&) {} // Deleted: A() = delete; A(const A&) = delete; A& operator=(const A&) = delete; }; int main() { std::vector<A> v; v.push_back(A(42)); return 0; }
But QVector requires A() and A(const A&) which I don't want to have (since they break my semantics and std::vector is quite happy without them).
Related topic: http://stackoverflow.com/questions/33380402/what-is-the-reason-of-qvectors-requirement-for-default-constructor .
Off topic: looks like QVector(int size, const T& value) solves this one: QTBUG-45488 .
Best regards.
Attachments
Issue Links
- relates to
-
QTBUG-45488 QVector initialization without default-constructed values for trivial types
- Closed