Actually if you just want to use Linq for list comprehension, you can use this Linq library. It requires C++11(it will work in MSVC 2010 though) and Boost. With the library you can write linq queries like this:
struct student_t
{
std::string last_name;
std::vector<int> scores;
};
std::vector<student_t> students =
{
{"Omelchenko", {97, 72, 81, 60}},
{"O'Donnell", {75, 84, 91, 39}},
{"Mortensen", {88, 94, 65, 85}},
{"Garcia", {97, 89, 85, 82}},
{"Beebe", {35, 72, 91, 70}}
};
auto scores = LINQ(from(student, students)
from(score, student.scores)
where(score > 90)
select(std::make_pair(student.last_name, score)));
for (auto x : scores)
{
printf("%s score: %i\n", x.first.c_str(), x.second);
}
Which will output:
Omelchenko score: 97
O'Donnell score: 91
Mortensen score: 94
Garcia score: 97
Beebe score: 91