By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,709 Members | 1,650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,709 IT Pros & Developers. It's quick & easy.

Type name expected: Errors

P: n/a
Could someone please tell me what I'm doing wrong? The compiler barks at me
whenever I throw (bad_alloc). If I remove this the code compiles just fine.

template < class DT, class KF >
class BSTree;

template < class DT, class KF >
class BSTreeNode
{
private:
friend class BSTree<DT,KF>;
};

template < class DT, class KF >
class BSTree
{
void insert ( const DT &newDataItem )
throw ( bad_alloc );
};

template < class DT, class KF >
void insert ( const DT& newDataItem )
throw ( bad_alloc )
{

}

int main()
{
BSTree<int,myStruct> X;
return 0;
}

---------- Capture Output ----------
"C:\Borland\BCC55\Bin\bcc32.exe" C:\lab11\Text3.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
C:\lab11\Text3.cpp:
Error E2303 C:\lab11\Text3.cpp 15: Type name expected
Error E2303 C:\lab11\Text3.cpp 20: Type name expected
*** 2 errors in Compile ***
Terminated with exit code 1
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gentlemen,

Thank you, I have finally figured out my problem.

Andrew
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.