joboccara/pipes

error: no viable overloaded '>>='

Opened this issue · 1 comments

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?

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?