Enumerable::SelectMany from Visual C++

I looked long and hard for a suitable sample of the Enumerable::SelectMany static method in C++, but could not find one.  After some tweaking and converting from C#, I now have a suitable example.  The tricky part when converting this FROM C# is that C# does not require the extra Select inside the SelectMany, but C++ requires it.

This code takes a two dimensional array of strings and collapses it into a distinct list of strings.
Part of the magic was figuring out to cast the array as an IEnumerable^>^, which was apparent after first creating this in C#.

I had to change this to a graphic as my code importer was stripping off things in angle brackets.


PlayWithRiderCodeCpp

posted @ Wednesday, June 3, 2015 10:51 AM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)

 
 
 
 

Live Comment Preview: