4

Possible Duplicate:
Is there a LINQ library for C++?

I am currently working on mixed C# / native C++ projects, and I find I sorely miss the conciseness of LINQ in my C++ code.

All I want is the core functionality, that is, to write code of the form;

auto adaptor = 
    myCollection
    .Where([filterlambda])
    .Select([transformlambda])

Ive seen a mockup or two to that extent on blogs/forums; neither of which are in a useable state.

I know there is such a thing as boost::range, but aside from being nowhere near the cleanliness im looking for, after staring at compiler arguments way beyond my template-fu for a day, I eventually discovered it doesnt take lambdas as arguments; at least not as implemented by the MSVS2010 compiler, which is a showstopper for me.

I cant believe something like this doesnt exist yet; google seems pretty insistent on the matter though, but id love to be proven wrong...

Community
  • 1
  • 1
  • Possible duplicate of [Is there a LINQ library for C++?](http://stackoverflow.com/questions/232222/is-there-a-linq-library-for-c). Specifically the second answer has a pointer to one such library. I don't know if there are more available. – David Rodríguez - dribeas Jan 14 '11 at 15:44
  • 1
    It's called the STL, and it's been part of the standard for a while ;) – Billy ONeal Jan 14 '11 at 16:51
  • @Billy: im curious how youd manage to get that kind of syntax out of the STL. Last time I checked it involved lots of convoluted iterator-pair syntax. – Eelco Hoogendoorn Jan 14 '11 at 17:09
  • @David: Thanks, that is indeed close to a duplicate, and contains some references that seem useful, at least at first glance. They all seem to be pre-C++0x though, so hopefully they work with native lambdas rather than the turnoff that is boost::lambda. – Eelco Hoogendoorn Jan 14 '11 at 17:11
  • @Eelco: It's not the same syntax, but the functionality is all there. As far as C++0x goes, 1. it's not yet standard, and 2. no compiler supports all the additions as of yet. – Billy ONeal Jan 14 '11 at 17:52
  • @Billy: All the functionality is in a Turing machine, too :). – Eelco Hoogendoorn Jan 14 '11 at 23:22
  • The pstade::oven library referenced in the other tread is pretty solid, by the way. That said, it does choke on C++0x lambda's, which is a shame; hope they bring it up to speed soon. – Eelco Hoogendoorn Jan 14 '11 at 23:26
  • @Eelco: I meant all the algorithms that LINQ uses, lol. – Billy ONeal Jan 15 '11 at 05:40

0 Answers0