C++ Logo

std-proposals

Advanced search

Re: Partial type definition

From: Valery Osheter <valery.o_at_[hidden]>
Date: Wed, 25 Aug 2021 07:28:41 +0300
I see that the discussion goes to the direction I did not expect.
So maybe the caption should be changed from "partial type definition" to
"declaration of methods outside of the class definition". This is my real
intent. I think it does not hurt ODR, because ODR requires only one
definition and allows several equvalent declarations. If the declarations
are not equal, the linker fails just like in case of plain function in C++.

I hope that this feature so simple and attractive, the compilers can do it
literally tomorrow.

On Tue, Aug 24, 2021, 23:08 Ville Voutilainen <ville.voutilainen_at_[hidden]>
wrote:

> On Tue, 24 Aug 2021 at 23:05, Ville Voutilainen
> <ville.voutilainen_at_[hidden]> wrote:
> > I doubt it's viable to allow the real definition of X to omit the
> > things defined in the partial definition. A translation
> > unit that sees the real definition might not see the partial
> > definition, and then you have a serious ODR problem.
>
> ..which is not to say that this idea isn't riddled with different ODR
> problems to begin with, though. :)
>

Received on 2021-08-24 23:28:57