Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pc lint error 534 when using templates

Status
Not open for further replies.

spoddynerd

Programmer
Dec 11, 2002
33
GB
The following code results in lint error 534 (see code comment). It only happens when SomeClass is a template class and contains an instance of VectorInt.

I can't see what is wrong with this, and Purify doesn't seem to pick up any memory leaks.

template <class T>
class SomeClass
{
public:

SomeClass() : vectorInt() {};
~SomeClass(){};
typedef std::vector<int> VectorInt;
private:
VectorInt vectorInt;
};

void main(void)
{
for(;;)
{
SomeClass<int>* someClass = new SomeClass<int>(); //causes pc lint error 534 - ignoring return value from new
delete someClass;
}
}
 
I copied your code and complied it with MSVC++ 6 and it works fine. What compiler are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top