Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 1e64c52

Browse files
n8shGeod24
authored andcommitted
Fix Issue 21468 - Inscrutable template error when core.stdcpp.vector of a struct with a core.stdcpp.vector field is referenced before the struct's definition
Related discussion at https://forum.dlang.org/thread/efjydhujahujqjrvmnsk@forum.dlang.org
1 parent 592d98c commit 1e64c52

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/core/stdcpp/vector.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ enum Default = DefaultConstruct();
3030

3131
extern(C++, "std"):
3232

33-
extern(C++, class) struct vector(T, Alloc = allocator!T)
33+
alias vector(T) = vector!(T, allocator!T);
34+
extern(C++, class) struct vector(T, Alloc)
3435
{
3536
import core.lifetime : forward, move, core_emplace = emplace;
3637

test/stdcpp/src/vector_test.d

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import core.stdcpp.vector;
22

33
alias TestIssue21323IsFixed = vector!(vector!int);
44

5+
void testIssue21468IsFixed(vector!StructWithAVector a) {}
6+
7+
struct StructWithAVector
8+
{
9+
vector!int a;
10+
}
11+
512
unittest
613
{
714
// test vector a bit

0 commit comments

Comments
 (0)