popFirstMaybe

Try to pop first occurrence of needle in haystack (if any).

bool
popFirstMaybe
(
alias pred = "a == b"
C
E
)
(
ref C haystack
,
in E needle
)
if (
hasMember!(C, "length") &&
hasMember!(C, "popAt")
)

Return Value

Type: bool

true iff pop was made, false otherwise.

Meta