[resolved] internal compiler error...

This is a discussion on [resolved] internal compiler error... within the C++ Programming forums, part of the General Programming Boards category; i'm using .net2003 and the compiler is giving me an internal compiler error when i try to create a template ...

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    188

    [resolved] internal compiler error...

    i'm using .net2003 and the compiler is giving me an internal compiler error when i try to create a template class. here is the code:

    Code:
    namespace NS
    {
        template <typename T>
        class A
        {
        public:
            A();
    
            void Insert(const T& t);
        };
    }
    
    namespace NS
    {
        template <typename T>
        A<T>::Insert(const T& t)
        {
        }
        template <typename T>
        A<T>::A()
        {
        }
    }
    that's all it takes for the compiler to poop out. i took this code out and put it into an empty project, and it compiles fine... if i comment this code out in the original project, it fails to compiler. uncomment, compiler fails.

    i'm at a loss of how to troubleshoot this. any help is appreciated. thanks.

    EDIT: sorry i jumped the gun...i didn't have the 'void' keyword for the return type in the implementation.
    Last edited by bling; 12-10-2008 at 12:21 PM.

  2. #2
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    You appear to be missing void from in front of A<T>::Insert
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,269
    Quote Originally Posted by iMalc View Post
    You appear to be missing void from in front of A<T>::Insert
    True but that's no excuse for the compiler to explode. I'd report it.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 02:29 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 02:17 PM
  3. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 07:17 PM
  4. using c++ in c code
    By hannibar in forum C Programming
    Replies: 17
    Last Post: 10-28-2005, 10:09 PM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 11:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21