|
-
Nov 5th, 2001, 12:40 PM
#1
Thread Starter
transcendental analytic
Compiler Confused
F:\C++\t1_\t1.cpp(109) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
PHP Code:
class a{
public:
template <class b>
class c{};
};
template <class e, class f>
class h: public e{
public:
e::c<f> g;
};
MSVC doesn't compile this, even if no class is instantiated, if i rename c in class a, it will show a bunch of errors instead of the above. Anyone have any ideas why?
Anyone with any other compiler that can compile this, so that I can see if it is something impossible in C++ or if it's just the poor MSVC compiler that sucks.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 5th, 2001, 01:35 PM
#2
Either your code has a typo or it cannot possibly work (it can't now):
e::c<f> g;
This line is absolutely impossible. You assume that e is a class with a included template class named c. It could work if you declared it as
a::c<f> g;
but even then you risk h being derived from any data type, like ints, floats or enums! It could well be that this produces the error.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 5th, 2001, 01:41 PM
#3
I tried. It compiles if you change e::c to a::c.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 5th, 2001, 02:20 PM
#4
Thread Starter
transcendental analytic
it's an acceptable solution, but it freaks me out that i have to leave some generic programming out :/
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 5th, 2001, 04:05 PM
#5
yeah, but the compiler just can't assume that there's an embedded class/struct/enum named c in the template parameter e. Maybe in future releases, but I don't think so.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|