In 10.1 the method signature to check if a BST is balanced is
bool IsBalanced(const unique_ptr<BSTNode<int>>& tree) { }
Isn’t this poor form? Herb Sutter states that “An object of type std::unique_ptr should be passed as a non-const reference, or by value. Passing by non-const reference signifies that the parameter is an in/out parameter. Passing by value signifies that the parameter is a sink (i.e. takes ownership and does not return it). A const reference std::unique_ptr parameter provides no benefits and restricts the potential callers of the function.” [1]
Shouldn’t we really just have unique_ptr<BSTNode<int>>&
?