Thread View: comp.std.c++
1 messages
1 total messages
Started by Beman Dawes
Wed, 15 Nov 1995 01:29
Re: Some questions about standard library
Author: Beman Dawes
Date: Wed, 15 Nov 1995 01:29
Date: Wed, 15 Nov 1995 01:29
28 lines
1738 bytes
1738 bytes
fresl@master.grad.hr (Kresimir Fresl) writes: >I have few questions (or maybe themes for discussion) about some >design decisions in standard library. I started to read articles in >comp.std.c++ only recently, so maybe some of them were already discussed. > >1. `struct pair <T1, T2>' has only one constructor: > pair(const T1& x, const T2& y). > As far as I know, compiler can generate copy constructor, but, > because there is one constructor, it can't generate default > constructor. > > But then you can not do this: > vector < pair <int, int> > v (5); > because first default argument of constructor for `vector<T>' is a call > to default constructor of T. Some other `vector' member functions also > expect default constructor of T. So, I think that `pair' should also have > default constructor. A default constructor for pair<> was added by the committee last week in Tokyo. --Beman Dawes (beman@dawes.win.net) --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads