16 Jan
2018
16 Jan
'18
5:18 p.m.
It can still be worth it because it's more likely to occur in a context where the compiler can see what category is being used. When you have
error_code ec( r, system_category() );
and system_category() is constexpr, the compiler knows with certainty what the call category().failed( r ) will do, so it will replace it with r != 0.
See f.ex. https://godbolt.org/g/6wGjCu