It's a big damn mess, but this curry works better...in C++14.