All pastes #793577 Raw Edit

Something

public cpp v1 · immutable
·published 2007-11-22 12:09 UTC
rendered paste body
#include <string>    class WeirdCpp {    public:       friend std::ostream& operator<<(std::ostream &of,const WeirdCpp &c);    };       std::ostream &operator<<(std::ostream &of, const WeirdCpp &c){        of << "apa"; //this doesn't work, gives/*        weirdcpp.h: In function ‘std::ostream& operator<<(std::ostream&, const WeirdCpp&)’:        weirdcpp.h:8: error: no match for ‘operator<<’ in ‘of << "apa"’        weirdcpp.h:7: note: candidates are: std::ostream& operator<<(std::ostream&, const WeirdCpp&)*/                //this works        of << std::string("apa");                return of;    }