Template <typename ... Args>

template
struct pick_first;

template
struct pick_first
{
using type = T;
};

template
using pick_first_t = typename pick_first::type;

template
struct deduce_first_parameter
{
private:
template
struct extract_function;

template
struct extract_function
{
using type = typename Operation::type;
};

template
struct extract_function
{
using type = typename Operation::type;
};

template
using extract_function_t = typename extract_function::type;

public:
using type = extract_function_t;
};

template
struct deduce_first_parameter
{
using type = pick_first_t;
};

Attached: Z.jpg (400x400, 11K)

Can I get a quick rundown on what the fuck is going on here?

Given any callable, deduces the first parameter in the parameter list of the function

#include
#include

struct dummy
{
void operator()(std::vector&) {}
using correct_answer = std::vector&;
};

struct not_so_dummy
{
using correct_answer = const std::vector&;
void operator()(const std::vector&) {}

};

void f(char, int);

int main()
{
static_assert(std::is_same::value);
static_assert(std::is_same::value);
static_assert(std::is_same::value);
}

so this is like... C++ version of pattern matching on lists?

If you're too much of a brainlet to understand such a simple metalanguage then maybe you should leave programming to the Indians and women.

BEAUTIFUL

>2018
>being confused by template templates
what's difficult to understand

Gimme a break dude, no one needs to know this stuff outside of a few niche areas.

>metaprogramming is "niche"
yeah man fuck lisp what a piece of shit language no one ever accompished anything by writing that

The hilarious part is that, if something is wrong in this, the error message would be way less readable than some macro expansion error.

>If you're too much of a brainlet to understand why macros/full compile time execution would have been an infinitely better solution for C++ than "advanced" template metaprogramming, metaclasses etc. combined then maybe you should leave the C++ standard cumittee.
FTFY