fork(1) download
#include 
    #include 

    class MyClass : public std::istringstream{
    public:
        using std::istringstream::operator >>;
        MyClass(const char* st) : std::istringstream(st){}
        void operator>>(std::string& st){st = this->str();}
    };

    int main()
    {
        MyClass my("bla tmp");
        std::string tmp;
        my >> tmp; // now tmp == "bla temp" and this is exactly what I wanted
        //but this does not work
        int kk;
        my >> kk; //gives me "now match for operator>>"
    }
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout

Standard output is empty