Ad
  • Default User Avatar

    It's not even C++11, it's been in C++ for many years, if not from the beginning.

  • Custom User Avatar

    Hey :) How are you doing?

    Please look at the above comments, marked as issues. It's something realted to Boost Library.

  • Default User Avatar

    Got the following error. I believe I did not use anything that is 'boost' (I'm not even familiar with that library as of yet).
    Please fix. Perhaps you could limit your preprocess to include only the string and algorithm.
    This is an epic fail for C++ version.

    "-isystem /runner/frameworks/cpp fatal error: 'boost/algorithm/string/join.hpp' file not found
    #include <boost/algorithm/string/join.hpp>
    ^
    1 error generated."

  • Default User Avatar

    C++11: the & unary operator can be used in method parameters so the program can make a call by referrence without the need to use pointers.
    thus in function prototype: "std::string declareWinner(Fighter &fighter1, Fighter &fighter2, std::string firstAttacker)"
    the fighter1 and fighter2 will be treated as normal variables and programmers don't have to use the "->" to call object members methods within
    functions rather, programmers could use the "." dot operator as if you're using them like a non-pointer variables.

    Also when you made the function call "declareWinner(&fighter1, &fighter2, "Lew"); " the "&" prefix can(should) be ommited in the fighter1 and fighter2 identifiers.

    What I'm saying is that the C++ committee introduced this in 2011 for the convenience of modern programmers and so we should use it, in practice and in profession.