Skip to content

Cannot use function output as initial value #10

Description

@amosialek

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions