On 28 November 2022 08:13:57 CET, Jason McKesson via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
On Sun, Nov 27, 2022 at 10:30 PM Ryan Klaus via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
On Sun, Nov 27, 2022 at 9:05 PM Jason McKesson via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
Template specialization is a thing. The parameters don't have to be
the ones in the primary template.
Sorry, but I'm not sure we're on the same page here. I'm aware of template specialization, but how would template specialization allow me to omit namespaces inside a template parameter list?
It wouldn't. What I'm saying is that the template arguments you give a
template don't have to be the same ones as the parameters, due to
specialization. Therefore, the compiler cannot *know* where `<RGBA,
_8888>` should come from.
Consider the following specialization:
```
template <Value1 val, Value2 val2>
class Color<ToColorComponents(val2), ToLayout(val1)> { ... };
```
What if `Value1` is an enumeration that just so happens to have an
RGBA enumerator? Which enumerator gets used?
Or what if you have this:
```
template <typename T, ABC::ColorComponents layout>
class Color<T::component, layout> { ... };
struct RGBA
{
static inline constexpr ABC::ColorComponents component = ...;};
Color<RGBA, _8888>
```
Which one gets used?