Re: VC++ .NET 2002 и частичная специализация (?)
От: MaximE Великобритания  
Дата: 18.05.03 08:45
Оценка: 1 (1)
Здравствуйте, al_kotov, Вы писали:

AK>
AK>#include <list>

AK>using namespace std;

AK>struct t;
AK>list<t> a;

AK>struct t {
AK>  int i;
AK>}

AK>int main( int argc, char *argv[] ) {
AK>    return 0;
AK>}
AK>


AK>не компилируется этим VC++ .NET 2002 вообще. Причем VC++ 6.0 SP5 никакого криминала не находит. Как, впрочем, и gcc 3.2.3. В результате чего я уже пару часов в ступоре


Стандартные контейнеры запрещено инстанцировать неполными типами.

Подробнее читай Containers of Incomplete Types:

The C++ Standard says that you're not allowed to instantiate a standard library template with an incomplete type: "the effects are undefined ... if an incomplete type is used as a template argument when instantiating a template component." Some implementations do permit it in some circumstances, but that's just an accident. (Remember, "undefined behavior" covers absolutely anything — including things working as you might expect them to!)


... или сделай поиск по форуму по фразе "неполный тип".
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.