using std.algorithm to find intersection of DateTime[][] arg

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 9 13:28:34 PDT 2015


I have a DateTime[][] arg (actually my own date type, but that 
shouldnt matter).  Ordered by time series ticker (eg a stock) and 
then the date.

eg arg[0] might be the dates relating to IBM and arg[0][0] would 
be the date of the first point in IBM time series.

I would like to find the intersection of the dates.

so setIntersection(arg[0],arg[1],arg[2] .. arg[$-1])
except that I don't know how many series are in arg at compile 
time.

what's the most efficient way to use Phobos to find these?  (I 
could write a loop, but I am trying to learn how to use 
std.algorithm better).


More information about the Digitalmars-d-learn mailing list