Skip to content

Commit

Permalink
niknaks.containers
Browse files Browse the repository at this point in the history
- Cleaned up
  • Loading branch information
deavmi committed Oct 29, 2024
1 parent 7a918d4 commit 946faed
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions source/niknaks/containers.d
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ private version(unittest)
}
}

private version(unittest)
{
struct Person
{
private static size_t _g = 0;
size_t uniq;
this(int)
{
this.uniq = ++_g;
}
}
}

/**
* Represents an entry of
* some value of type `V`
Expand Down Expand Up @@ -2253,29 +2266,16 @@ unittest
assert(t2 is t1);
}

// TODO: Move to top of module
version(unittest)
{
struct Person
{
private static size_t _g = 0;
size_t uniq;
this(int)
{
this.uniq = ++_g;
}
}
}

/**
* Tests pooling with an `EntryType`
* which is a struct type
*/
unittest
{
// Struct-based types are supported
struct P {}
static assert(__traits(compiles, Pool!(P, int, false)()) == true);
}

unittest
{
Pool!(Person, int) p;
Person* t1 = p.pool(1);
assert(t1);
Expand Down

0 comments on commit 946faed

Please sign in to comment.