My question is about this code:
auto& lookup = container.template get<1>();
container.relocate(container.begin(),container.template project<0>(it));
1st: .template
From what I've found, this template keyword specified on my container is using a template, correct me if I'm wrong.
src: (Where and why do I have to put the "template" and "typename" keywords?)
2nd: project<0>(it)
Looking for the definition in the lib, I saw that it needed an iterator as a parameter, but I don't understand the project<0> (same for get<1>).
I found some information like this: https://theboostcpplibraries.com/boost.variant, and posts on Stack Overflow too, but I'm a little bit confused.
You are right about the reason why
templatecan be required. Note it is only required in dependent context (where the actual specialization of a template may depend on template parameters).The documentation is
here:Indices are accessed via
get<N>()Projection Of Iterators