|
|
От: |
MaximE
|
|
| Дата: | 18.05.03 08:45 | ||
| Оценка: | 1 (1) | ||
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>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!)