C++ Logo

sg7

Advanced search

Re: [SG7] SG7 Digest, Vol 11, Issue 2

From: Andrew Sutton <asutton.list_at_[hidden]>
Date: Wed, 4 Nov 2020 08:59:20 -0500
>
> Even if you declare a forward class D the error still persists...
>
> struct A2 {
> struct B {};
> struct D;
> consteval {
> -> fragment struct {
> B b = D(); //error
> B getB() { return D(); } //error
> };
> }
> struct D : B {};
> };
>
>
Well, yeah. D hasn't been defined at the point it's used.

Andrew

Received on 2020-11-04 07:59:33