This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/42242] vector::resize unnecessarily calls null constructor



------- Comment #2 from redi at gcc dot gnu dot org  2009-12-01 18:30 -------
On second thoughts, it might be necessary to split it into two overloads for
C++1x, because this should work:

#include <vector>

struct moveable {
    explicit moveable(int) { }
    moveable(const moveable&) = delete;
    moveable(moveable&&) { }
};

int main()
{
    std::vector<moveable> v;
    moveable m(0);
    v.resize(1, m);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42242


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]