pair (or template class) in constuctor

Levente Farkas lfarkas@mindmaker.hu
Fri Nov 2 09:44:00 GMT 2001


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!"



More information about the Libstdc++ mailing list