Topic: Ambiguous copy constructor


Author: b91926@fsgm01.fnal.gov (David Sachs)
Date: 1995/05/02
Raw View
Is a class like the following example "legal". Note the ambiguity
in the copy constructor.

class X
{
  public:
  X(const X&);
  X(volatile X&);
  // other stuff follows, but not X(X&);
}





Author: b91926@fsgm01.fnal.gov (b91926@fsgm01.fnal.gov)
Date: 1995/05/02
Raw View
From: b91926@fsgm01.fnal.gov (David Sachs)
Date: 2 May 1995 22:25:47 -0500
Organization: FERMILAB, Batavia, IL

Is a class like the following example "legal". Note the ambiguity
in the copy constructor.

class X
{
  public:
  X(const X&);
  X(volatile X&);
  // other stuff follows, but not X(X&);
}
--
| Fidonet:  b91926@fsgm01.fnal.gov 1:133/411.412
| Internet: b91926@fsgm01.fnal.gov
| Gateway:  Galaxy Information System (GIS) Atlanta





Author: tony@online.tmx.com.au (Tony Cook)
Date: 1995/05/03
Raw View
David Sachs (b91926@fsgm01.fnal.gov) wrote:
: Is a class like the following example "legal". Note the ambiguity
: in the copy constructor.

: class X
: {
:   public:
:   X(const X&);
:   X(volatile X&);
:   // other stuff follows, but not X(X&);
: }

I think so.  You would get an ambiguity error when you tried to
initialize from a object no cv-qualifiers or from an object with
both cv-qualifers.
--
        Tony Cook - tony@online.tmx.com.au
                    100237.3425@compuserve.com