Ad
  • Custom User Avatar
  • Default User Avatar

    Oh, thank you. I was starting to overload all the other operators. Didn't thought about <<.

  • Custom User Avatar

    The [unsupported type] thing is a problem with the C++ testing framework. You can fix the messages by adding operator << to your class:

    std::ostream& operator<<(std::ostream& os, const Add& add) {
      return os << add.get_n();
    }
    

    As to why it returns wrong result, I do not know yet.

  • Default User Avatar

    I pass the first 6 tests (a_single_call_should_compare_equal_to_the_number_passed_in, must_be_able_to_store_curried_functions, must_be_able_to_store_values, must_be_usable_in_a_normal_addition, must_be_usable_in_a_normal_subtraction and should_pass_some_example_tests). In particular, I pass all examples given in the kata-instruction.

    However, the last test (should_pass_some_tests_with_random_data) fails with

    Expected: equal to 1313
    Actual: [unsupported type]

    I don't know what needs to be supported in addition. Am I supposed to figure this out on my own?