The Solidity v0.8.0 Breaking Changes Docs says:
Checks for overflow are very common, so we made them the default to increase readability of code, even if it comes at a slight increase of gas costs.
And Checking the GitHub commits for SafeMath.sol I found this commit made on February 2021 were they added the comment:
NOTE: SafeMath is no longer needed starting with Solidity 0.8. The compiler now has built in overflow checking.
The comment was later Reviewed in this other commit, with the title Review wording of SafeMath need in Solidity 0.8, and changed to:
NOTE: SafeMath is generally not needed starting with Solidity 0.8, since the compiler now has built in overflow checking.
Checking the first commit linked, we can also see a comment made in the SignedSafeMath.sol contract that said:
Signed math operations that revert on error.
I think that's like saying they are checking for overflows.
Also, the wording changes seems to be aligned with the other answer here, noticing that you may reuse safemath as library to improve operation cost for example, as the default one is more expensive now according to the docs, or to improve the ** operator for bases different to 2 or 10.
But it does seems that SafeMath is indeed generally not needed starting with Solidity 0.8
Also the top comment in the safemath library now says:
CAUTION
This version of SafeMath should only be used with Solidity 0.8 or later, because it relies on the compiler's built in overflow checks.
Now the add function is :
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
And an earlier implementation was:
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
**
operator, with your implementation being more gas-efficient than solc 0.8's safe-implementation of this operator (same goes for each one of the other arithmetic operators of course, though doubtfully you could implement any of those in a better way than solc 0.8).**
operator, which is optimized for base 2 and base 10, under the assumption that most usages of this operator are for these two bases. So for example, if your system requires this operator for other bases, then you may come up with a better safe-implementation of it.