Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use function output as initial value #10

Open
amosialek opened this issue Dec 22, 2019 · 1 comment
Open

Cannot use function output as initial value #10

amosialek opened this issue Dec 22, 2019 · 1 comment

Comments

@amosialek
Copy link

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
Copy link
Author

what's more, following query would work

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

but

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

would not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant