Impressive that you were able to pull it off in C++17 like this (and extra kudos for the live link), but the resulting code (both template and invocation) looks very cryptic - except for the part commented out; that one is much more pleasant to the eye.