On Saturday, 12 March 2022 at 13:12:25 UTC, vit wrote:
```d
enum touch_T = __traits(hasMember, T, "touch");
```
I think you meant build instead of touch?
```d
struct Query {
public const SharedPtr!Builder builder;
}
interface Builder {
void build(ref Query query);
}
struct SharedPtr(T) {
}
```
```
src/app.d(3,1): Error: no size because of forward references
src/app.d(4,18): Error: template instance
`app.SharedPtr!(Builder)` error instantiating
```
Hello there,
I got a weird compilation error which was hard to debug (even for
just a little program) and I thought, this is quite related to
this thread. This is my error message:
```
***search.d(42,1): Error: class ***.XXX has forward references
***box.d(21,32): Error: template instance
On Thursday, 31 October 2019 at 12:37:55 UTC, user1234 wrote:
struct S
{
S*[] children;
}
because otherwise when you declare the array the compiler has
not finished the semantic ana of S.
---
struct Test
{
Test[] t;
}
---
Works today. Putting pointers into the container (and thus ha
On Thursday, 31 October 2019 at 12:37:55 UTC, user1234 wrote:
On Thursday, 31 October 2019 at 12:29:28 UTC, Tobias Pankrath
wrote:
[...]
Try
struct S
{
S*[] children;
}
because otherwise when you declare the array the compiler has
not finished the semantic ana of S.
so S size is not
On Thursday, 31 October 2019 at 12:29:28 UTC, Tobias Pankrath
wrote:
My Problem:
--- (https://run.dlang.io/is/CfLscj)
import std.container.array;
import std.traits;
struct Test
{
Test[] t;
}
struct Test2
{
Array!Test2 t;
}
int main()
{
return FieldTypeTuple!Test.length + FieldTy
My Problem:
--- (https://run.dlang.io/is/CfLscj)
import std.container.array;
import std.traits;
struct Test
{
Test[] t;
}
struct Test2
{
Array!Test2 t;
}
int main()
{
return FieldTypeTuple!Test.length + FieldTypeTuple!Test2;
}
---
I've found https://issues.dlang.org/show_bug.cgi
tor
{
// ...
override void visit(AggregateDeclaration ad)
{
//printf("AggregateDeclaration::semantic2(%s) type = %s, errors
= %d\n", ad.toChars(), ad.type.toChars(), ad.errors);
if (!ad.members)
return;
if (ad._scope)
{
ad.error
On Tuesday, 12 June 2018 at 20:30:22 UTC, Steven Schveighoffer
wrote:
On 6/12/18 4:14 PM, bauss wrote:
What could cause that error?
I cannot find anything in the documentation nor does the error
message itself give much information.
A forward reference that can't be figured out by the compil
On 6/12/18 4:14 PM, bauss wrote:
What could cause that error?
I cannot find anything in the documentation nor does the error message
itself give much information.
A forward reference that can't be figured out by the compiler. This is
one of the DMD front end's real weak spots.
I can't real
What could cause that error?
I cannot find anything in the documentation nor does the error
message itself give much information.
I can't really give a good example, but I can tell as much as I
have a few inheritances of classes using templates.
I just don't think that would be the issue.
still seems to be some
strangeness about forward references.
There are frequently issues with forward references. They are supposed
to always work, but it's not always the case.
-Steve
about forward references.
Thanks till now i guess :P
On 2/25/18 4:25 PM, Jiyan wrote:
Hi,
is there any document or text describing forward references?
It is kinda strange, i implemented a list structure which is kinda like
this:
struct list(T)
{
private:
struct node
{
T val;
node* next;
node* prev;
}
node* head;
node* last;
size_t size
works for me with 2.076.
Hi,
is there any document or text describing forward references?
It is kinda strange, i implemented a list structure which is
kinda like this:
struct list(T)
{
private:
struct node
{
T val;
node* next;
node* prev;
}
node* head;
node* last;
size_t size;
.
}
The thing is when i
Do the various D compilers use multiple passes to handle forward
references or some other technique?
On Tue, 13 Oct 2009 07:30:11 -0400, bearophile
wrote:
Steven Schveighoffer:
A static variable is essentially a scoped global variable. I think it
will work if you make it static. I've used plenty of static variables
that are instances of the struct they are declared in.
It doesn't compi
Steven Schveighoffer:
> A static variable is essentially a scoped global variable. I think it
> will work if you make it static. I've used plenty of static variables
> that are instances of the struct they are declared in.
It doesn't compile with static variables too, you just need few seco
On Mon, 12 Oct 2009 15:38:07 -0400, bearophile
wrote:
Steven Schveighoffer:
It looks strange what you are doing. A Foo can have a memory pool of a
lot of Foo's? Do you mean to make the memory pool static?
Right and yes.
I think that might work.<
It works if I use a global variable.
Ary Borenszweig:
> I can see MemoryPool!(Foo) sizeof doesn't depend at all of T.sizeof
> because it just has a pointer.
Well, a dynamic array of pointers, but the situation is the same.
>But how do you suggest to fix the compiler to understand that?<
I don't know. I don't know enough about co
Steven Schveighoffer wrote:
On Mon, 12 Oct 2009 05:26:58 -0400, bearophile
wrote:
What's wrong with this code?
struct MemoryPool(T) {
alias T[100_000 / T.sizeof] Chunk;
Chunk*[] chunks;
}
struct Foo {
int x;
MemoryPool!(Foo) pool;
}
void main() {}
It prints "Error: struct pr
Steven Schveighoffer:
> It looks strange what you are doing. A Foo can have a memory pool of a
> lot of Foo's? Do you mean to make the memory pool static?
Right and yes.
>I think that might work.<
It works if I use a global variable. But I'd like to not used global variables
when possible
On Mon, 12 Oct 2009 05:26:58 -0400, bearophile
wrote:
What's wrong with this code?
struct MemoryPool(T) {
alias T[100_000 / T.sizeof] Chunk;
Chunk*[] chunks;
}
struct Foo {
int x;
MemoryPool!(Foo) pool;
}
void main() {}
It prints "Error: struct problem.Foo no size yet for fo
> T.sizeof must be 8 in all cases.
Ignore this line, please :-)
What's wrong with this code?
struct MemoryPool(T) {
alias T[100_000 / T.sizeof] Chunk;
Chunk*[] chunks;
}
struct Foo {
int x;
MemoryPool!(Foo) pool;
}
void main() {}
It prints "Error: struct problem.Foo no size yet for forward reference".
T.sizeof must be 8 in all cases.
So I ha
Spacen Jasset Wrote:
> Jos van Uden wrote:
> > Jacob Carlborg Wrote:
> >
> >> On 8/16/09 19:36, Jos van Uden wrote:
> >>> Jacob Carlborg Wrote:
> >>>
> It works with dmd 1.045
> >>> Where to get it?
> >> http://www.digitalmars.com/d/1.0/changelog.html#new1_045
> >
> > Thank you. This versio
Jos van Uden wrote:
Jacob Carlborg Wrote:
On 8/16/09 19:36, Jos van Uden wrote:
Jacob Carlborg Wrote:
It works with dmd 1.045
Where to get it?
http://www.digitalmars.com/d/1.0/changelog.html#new1_045
Thank you. This version does indeed compile the libs, just like 1.033, but I
still get
Jacob Carlborg Wrote:
> On 8/16/09 19:36, Jos van Uden wrote:
> > Jacob Carlborg Wrote:
> >
> >> It works with dmd 1.045
> >
> > Where to get it?
>
> http://www.digitalmars.com/d/1.0/changelog.html#new1_045
Thank you. This version does indeed compile the libs, just like 1.033, but I
still get t
On 8/16/09 19:36, Jos van Uden wrote:
Jacob Carlborg Wrote:
It works with dmd 1.045
Where to get it?
http://www.digitalmars.com/d/1.0/changelog.html#new1_045
I also tried compiling derelict today. I finally managed to get past the error
messages by using the dmd compiler that ships with
Jacob Carlborg Wrote:
> It works with dmd 1.045
Where to get it?
I also tried compiling derelict today. I finally managed to get past the error
messages by using the dmd compiler that ships with tango. 1.033 if I remember
correctly. The lib folder filled up nicely with files. Then I did a dsss
Spacen Jasset wrote:
Hello, trying to use deteclit with the latest version of dmd 1.047
and I get this error. I don't understand what it means:
derelict\freetype\fttypes.d(827): Error: struct
derelict.freetype.fttypes.FT_RasterRec has forward references
line 97: alias FT_Rast
On 8/13/09 17:01, Spacen Jasset wrote:
Hello, trying to use deteclit with the latest version of dmd 1.047
and I get this error. I don't understand what it means:
derelict\freetype\fttypes.d(827): Error: struct
derelict.freetype.fttypes.FT_RasterRec has forward references
line 97:
Hello, trying to use deteclit with the latest version of dmd 1.047
and I get this error. I don't understand what it means:
derelict\freetype\fttypes.d(827): Error: struct
derelict.freetype.fttypes.FT_RasterRec has forward references
line 97: alias FT_RasterRec* FT_Raster;
34 matches
Mail list logo