auto_ptr member gives = no matching function for call to :(

Thu Jun 12 19:00:00 GMT 2008

hi cant seem to get my exception class to work. It works fine in microsoft
vc9, but wont compile in gcc. here is the error

no matching function for call to
candidates are: ExceptionHandler::ExceptionHandler(ExceptionHandler&) 
		ExceptionHandler::ExceptionHandler(const int&) 

------------------------------------here is the main file-------------------
int main(int argc, char *argv[])
 	throw ExceptionHandler(100);  // this generates error
    return EXIT_SUCCESS;

-----------------here is the cpp file---------------------------------
#include <iostream>
#include <sstream> 
#include <memory> 
#include <stdexcept>

using namespace std;

class ExceptionHandler: public runtime_error
	mutable auto_ptr<stringstream> autoPtr_sstream;  // error is due to this
		ExceptionHandler(const int &int_errCode):runtime_error("")
		{  autoPtr_sstream.reset(new stringstream());	}						 		
	~ExceptionHandler() throw(){}

what is the problem here?
View this message in context:
Sent from the gcc - libstdc++ mailing list archive at

More information about the Libstdc++ mailing list