Or actually, it's wasteful to sort the vector twice, better sort once and save in a temp variable:
std::vector<T> temp = this->sorted();
return (temp[s / 2 - 1] + temp[s / 2]) / 2;
Now that I look at this cleaner version,
it's clear that this won't work if the vector is empty,
because if s == 0 this will end up referencing temp[-1].
This was not so easy to see in the original version, now it's obvious.
This was just the worst example I found, but in many many places you use far more parentheses than you need. I suggest to review the entire code and trim a little bit.