Topic: virtual ^foo() = 0 {}; legal?


Author: paul.black@vf.vodafone.co.uk
Date: 1996/09/11
Raw View
Marc Girod <girod@trshp.trs.ntc.nokia.com> wrote:
>
> >>>>> "HS" == Herb Sutter <herbs@cntc.com> writes:
>
> HS>   class foo
> HS>   {
> [...]
> HS>      virtual ~foo() = 0 {}; // out of habit, good style
> HS>   };
>
> I didn't get an answer to my question yet: Is this legal?
> ....given that I know that the following equivalent is legal:
>
>     virtual inline ~foo() = 0;
> };
> foo::~foo() {}
>
> Any taker?
>
> Best Regards!
> --
> Marc Girod                                   Phone:  +358-0-511 27703
> Nokia Telecommunications   P.O. Box 12       Fax:    +358-0-511 27432
> Kilo RD 4                  FIN-02611 Espoo   marc.girod@ntc.nokia.com

I don't think that this is legal. The pure specifier ("= 0") is shown in the
grammar of the draft as being part of a declaration only whereas

        virtual ~foo() = 0 {};

is a definition (as well as a declaration).

Paul
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]