Код прост. Вот ссылка: https://godbolt.org/z/xe49MxoMM
Ошибка отчета msvc:
(6): error C2039: 'VertexCount': is not a member of 'Derived'
(10): note: see declaration of 'Derived'
(6): note: the template instantiation context (the oldest one first) is
(10): note: see reference to class template instantiation 'Base' being compiled
(6): error C2065: 'VertexCount': undeclared identifier
(6): error C2131: expression did not evaluate to a constant
(6): note: a non-constant (sub-)expression was encountered
Compiler returned: 2
Изменить:
Вот код:
#include
template
class Base {
public:
static constexpr int VertexCount = T::VertexCount;
};
class Derived : public Base {
public:
static constexpr int VertexCount = 3;
};
int main() {
std::cout
Подробнее здесь: https://stackoverflow.com/questions/793 ... -in-c20-bu
Почему следующий код успешно компилируется с GCC и Clang в C++20, но не компилируется с MSVC в C++20? [дубликат] ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Почему эта перегрузка оператора компилируется в MSVC и GCC, но не в Clang?
Anonymous » » в форуме C++ - 0 Ответы
- 37 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Рекурсивное использование оператора noException компилируется в gcc, но не в clang и msvc.
Anonymous » » в форуме C++ - 0 Ответы
- 25 Просмотры
-
Последнее сообщение Anonymous
-