And all of the above is inside the namespace "ABC".
In a just world, I feel like I should be able to right something like this:
auto color = ABC::Color<RGBA, _8888>{};
The compiler knows it wants a
ColorComponents followed by a
ColorComponentLayout, so all of the contextual information is theoretically there.
But this is not a just world and so I'm forced to write this incantation:
auto color = ABC::Color<ABC::ColorComponents::RGBA, ABC::ColorComponentLayout::_8888>{};
So my proposal is to create some new attribute, [[context(...)]], such that we could write:
[[context(using enum ColorComponents, using enum ColorComponentLayout)]]
template <ColorComponents T_components, ColorComponentLayout T_layout>
class Color { ... };
This essentially allows for any parameter list (function or template) to have using statements scoped only to the parameter list itself. This could also permit type aliases to allow for context specific parameter list aliases. Not sure when that would be useful, but I could see that potentially being a very handy space saver.
What's everyone's thoughts on this? Is it possible? Is it not possible? Is it possible but we hate it?
Thanks,
Ryan Klaus