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

error: no viable overloaded '>>=' #65

Open
theShmoo opened this issue Feb 16, 2021 · 1 comment
Open

error: no viable overloaded '>>=' #65

theShmoo opened this issue Feb 16, 2021 · 1 comment

Comments

@theShmoo
Copy link

My simple test code is not compiling:

#include <string>
#include <iostream>

// first problem: WHY DO I NEED OPTIONAL HERE?
#include <optional>

#include "pipes/transform.hpp"
#include "pipes/to_out_stream.hpp"

int main()
{
    std::string test{"ABC"};
    test 
        >>= pipes::transform([](char c){return c + 2; })
        >>= pipes::to_out_stream(std::cout);
}

https://godbolt.org/z/PsM9Yf

For the first problem see #64

For the actual problem:

Compiling this gives an error message:

<source>:15:9: error: no viable overloaded '>>='
        >>= pipes::to_out_stream(std::cout);
        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiler returned: 1

what am i missing here?

@theShmoo
Copy link
Author

theShmoo commented Feb 16, 2021

Ok I got it.

You just have to include:

#include "pipes/operator.hpp"

https://godbolt.org/z/G3znGG

maybe the pipes should include this by default?

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