Код: Выделить всё
#include
#include
template
struct a {
template
using f = T0;
};
template
struct b {
template
using f = typename a::template f;
};
static_assert(std::same_as);
int main() {
}
< /code>
ошибка: < /p>
:13:41: error: pack expansion used as argument for non-pack parameter of alias template
13 | using f = typename a::template f;
| ^~~~~
:12:5: note: in instantiation of template type alias 'f' requested here
12 | template
| ^
:16:28: note: in instantiation of template class 'b' requested here
16 | static_assert(std::same_as);
| ^
:6:17: note: template parameter is declared here
6 | template
| ^
Если я изменю экстремацию , чтобы быть зависимым на TS ... , затем он компилируется чистым:
Код: Выделить всё
template
struct b {
template
using f = typename a::template f;
};
Каковы соответствующие правила, которые регулируют это различие? Другими словами, почему версия, в которой специализация зависит от TS хорошо сформирована, но версия, где она не является плохо сформирована?
Подробнее здесь: https://stackoverflow.com/questions/794 ... k-paramete
Мобильная версия