"HOW to understand" complex code, is simply walking through it, one word (or line) at a time, and understanding exactly what it means. Often the best way to do this when you're starting out is to just find any #defines
and copy paste them in place.
Taking the first example (note this is HOW to work it out, not what it does)
template<class _Ty> inline
Ok, so we're looking at an inline template... I can look up on cppreference what they mean
_Post_equal_to_(_Left < _Right ? _Right : _Left)
Looks like a macro (because it's outside any {}) ... best find what that definition is, and post it in its place. If it calls other macros (it does) then I'll have to repeat until I understand exactly what it's doing.
constexpr const _Ty& (max)(const _Ty& _Left, const _Ty& _Right)
constexpr & const ... those I can look up at cpprefernce too.
_Ty& well, I know from my reading of template at cppreference that this is returning the type that the template is based on; and we get a return value and a left&right.
Maybe I've not seen that syntax (max) before for declaring a function... And I can't find any documentation on what's going on; and I'm not able to understand / find the c++ standard. I'll ask on Stack Overflow if it's valid syntax and if there's any reason to pick it over just max()
as that's a specific problem which I can post the results of research about; but I know it's accepted in MY compiler because I've tried it.
_NOEXCEPT_OP(_NOEXCEPT_OP(_DEBUG_LT(_Left, _Right)))
More macros - well, best find and paste those; it's actually related to another question Use of the noexcept specifier in function declaration and definition? So I'm going to read that to fast forward and save me time.
{ // return larger of _Left and _Right
return (_DEBUG_LT(_Left, _Right) ? _Right : _Left);
}
Well, only one macro to go (because it's all capitals) but we've already seen this one before.. and the helpful comment says what it does.
To answer the latter - why so many #define - that's quite simple. They wanted to. They didn't need to, and some would tend to frown upon their continued use. I don't think it's worth expanding on that point further since it's not going to help anyone.