Ad
  • Custom User Avatar

    This test should really have been a part of the sample tests.

  • Custom User Avatar

    tried it as well,
    dont know why i still get the error message:

    main.cpp:193:9: error: invalid operands to binary expression ('stringstream' (aka 'basic_stringstream') and 'X')
    out << X();
    ~~~ ^ ~~~
    /usr/include/c++/v1/ostream:191:20: note: candidate function not viable: no known conversion from 'X' to 'std::__1::basic_ostream &()(std::__1::basic_ostream &)' for 1st argument
    basic_ostream& operator<<(basic_ostream& (
    __pf)(basic_ostream&));

  • Default User Avatar

    Good Kata. I almost got tripped up at the end, when my code ran successfully with the sample test, but not the final test. Fortunatley I realised that I needed to overload the "<<" operator to allow printing of x without calling the print function (i.e. cout << x() == x.print() )