help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug or a feature


From: Paul Pluzhnikov
Subject: Re: bug or a feature
Date: Mon, 04 Jul 2005 11:10:38 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Anakreon <anakreonmejdi@yahoo.gr> writes:

> The command used for the compilation is:
> g++ -o bug gcc_bug.cpp
>
> The compiler must know that there are no other files involved.
>
> I don't want to waste anybodys time but shouldn't the compiler
> report an error on the above case?

There is no error in your test case; hence the compiler should not
report anything.

It is a perfectly legal C++ technique to declare, but not define
member functions. An example:

  class Base { ...
  protected:
       Base(const Base &);           // not implemented
       Base &operator=(const Base&); // not implemented
  };

The idea here is that instances of the Base class should not
be copied. The author of Base guarantees that if someone writes
Derived class which inherits from Base, they would not be able to
copy the Base part of Derived. If they do, they'll get an error at
link time.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]