Linq icon indicating copy to clipboard operation
Linq copied to clipboard

Cannot use function output as initial value

Open amosialek opened this issue 4 years ago • 1 comments

This code won't compile:

#include <linq.h>
#include<vector>
using namespace linq;
std::vector<int> f()
{
std::vector<int> result;
return result;
}
int main()
{
  auto x = f() | linq::first;
}

however this one will

#include <linq.h>
#include<vector>
std::vector<int> f()
{
std::vector<int> result;
return result;
}
int main()
{
  auto output = f();
  auto x = output | linq::first;
}

The issue is that LINQ should work with function output as well as with variable collection (and it does not)

amosialek avatar Dec 22 '19 17:12 amosialek

what's more, following query would work

output | linq::intersect(f());

but

f() | linq::intersect(f());

would not

amosialek avatar Dec 22 '19 17:12 amosialek