I have a class that holds some statically-sized containers:where a Container class might look like:Now I want to specialize the bar method based on the size of the container. I do not understand how to do that.
Quote from cppreference.com:Adding template specializationsIt is allowed to add template specializations for any standard library |class (since C++20)| template to the namespace std only if the declaration depends on at least one program-defined type and the specialization satisfies all requirements for the original template, except where such specializations are prohibited.
I need to write a templated function, that behaves differently depending on the class of its parameter:
In C++ is it possible to define multiple methods based of the number of template parameters provided? Similar to how variadic functions work?