[Issue 20166] among should have an overload for fixed-length arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 11 11:55:38 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=20166

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #1 from Nick Treleaven <nick at geany.org> ---
Presumably you mean a dynamic array. The docs for among say see also canFind.
That does what you want:

import std.algorithm.searching;
enum brackets = ['(', '[', '{', '}', ']', ')'];

static assert(brackets.canFind('('));

--


More information about the Digitalmars-d-bugs mailing list