On Thursday, 29 June 2017 at 20:21:13 UTC, Ali Çehreli wrote:
A workaround is to use a lambda:
filter!(a => isValid(a))(array)
Thanks! Nice trick, this is definitely going into my company's
codebase :-)
Such limitations are pretty annoying. There were a number of
similar issues in
On 06/24/2017 02:04 AM, Sebastien Alaiwan wrote:
> private:
>
> void privateFunction1()
> {
> auto array = [0, 1, 2, 3, 4, 5];
> auto result = filter!isValid(array); // error: 'isValid' is private
> }
> bool isValid(int i)
> {
> return i % 2 == 0;
> }
A workaround is to use a lambda:
up please!
Hi,
I'm trying to call std.algorithm.iteration.filter with a private
function as a predicate.
Here's a reduced example code:
// yo.d
import std.algorithm;
void moduleEntryPoint()
{
privateFunction1();
privateFunction2();
}
private:
void privateFunction1()
{
auto array = [0, 1, 2, 3,