My sincerest apologies, my initial solution is flawed due to a
foolish oversight. The below version works.
```d
bool contains(M, K...)(M map, K keys)
if (K.length > 0) {
static if (K.length == 1)
return (keys[0] in map) !is null;
else
return (keys[0] in map) !is null && contains(map[
On Monday, 4 March 2024 at 23:49:46 UTC, Lettever wrote:
[ ... ]
```d
// A template constraint is added to ensure we may always index
into `keys`,
// in addition to being a sanity check.
bool contains(M, K...)(M map, K keys)
if (K.length > 0) {
static if (K.length == 1)
return (keys[0]
I am trying to create a function that tests membership in nested
associative array, however the function I create below, only
accepts keys of the same type and if given keys of different
types it does not compile, help would be appreciated.
This is a example of what Im talking about.
```d
impor