This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
pair (or template class) in constuctor
- From: Levente Farkas <lfarkas at mindmaker dot hu>
- To: STDC++ <libstdc++ at sources dot redhat dot com>,GCC-Bugs <gcc-bugs at gcc dot gnu dot org>
- Date: Fri, 16 Nov 2001 14:43:54 +0100
- Subject: pair (or template class) in constuctor
- Organization: Mindmaker Ltd.
- Reply-to: lfarkas at mindmaker dot hu
hi,
May be it's not a stdc++ question, but why the first type of constructor
do not compile with g++? and why the second compile?
-------------------
include <utility>
class A
{
std::pair<char*, long> p;
public:
//A(std::pair<char*, long> r = std::pair<char*, long>(0, 0L));
A(std::pair<char*, long> r = std::make_pair((char*)(0), 0L));
};
A::A(std::pair<char*, long> r) : p(r) {}
int main()
{
A a;
return 0;
}
-------------------
Thanks in advance.
-- Levente "Si vis pacem para bellum!"