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

someDev compressor@gmail.com
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
`ExceptionHandler::ExceptionHandler(ExceptionHandler)' 
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
 	
    system("PAUSE");
    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
public:	
		ExceptionHandler(const int &int_errCode):runtime_error("")
		{  autoPtr_sstream.reset(new stringstream());	}						 		
	
	~ExceptionHandler() throw(){}
};
---------------------------------------------------------------

what is the problem here?
-- 
View this message in context: http://www.nabble.com/auto_ptr-member-gives-%3D-no-matching-function-for-call-to-%3A%28-tp17807375p17807375.html
Sent from the gcc - libstdc++ mailing list archive at Nabble.com.



More information about the Libstdc++ mailing list