So, I have incorporated (all) your feedback in the proposal:
- now the feature is opt-in
- private/protected/public keywords are used: template<public typename A, protected int B>
- New compiler errors are discussed: when there is a propagated template parameter and user-defined one with the same name.
Here is a link to the proposal (leading directly to the new opt-in approach).
"Namely, do we want to have references (static constexpr int &B = _B; in the example above), or values (static constexpr int B = _B;)?
No matter how smart structures it will be possible to use as template arguments, (after instantiation) they are just smartly-mangled (16IntegralConstantIPFiRiEXadL_Z3fooIiEiRT_EEE) old plain C structs, and they are entirely handled in compile-time. From this point of view, there is little point in using references. Perhaps, a safer approach would be to understand how compile-time calculations implemented in the modern compilers, in particular whether "compile-time reference" makes sense or not."