|
Boost : |
Subject: [boost] Error Handling issue in NonCopyable Interface
From: John Pallino (johndb264_at_[hidden])
Date: 2014-08-07 23:27:51
Hello,
I am having error handling issues that is in regards to the NonCopyable Interface library.
Here is the source code:
#include <boost/noncopyable.hpp>
#include <iostream>
class A : public boost::noncopyable {
public:
A() { std::cout << "In A \n" << std::endl; }
class AnError
{};
void Func()
{
if () //error condition
throw AnError();
}
};
int main()
{
try
{
A object1;
A object2(object1);
object1 = object2;
}
catch (A::AnError)
{
//tell user about error.
}
return 0;
}
}
So far, I have tried on the forums in CPlusPlus.com and MSDN, but no responses.
Since that Boost.org has created and authored the NonCopyable.hpp library, I would like to get some assistance.
Can anybody give me some solutions on how to suppress any compilation errors?
Thanks in advance. Email me back at the Cc: if you have any answers or comments with detailed information and examples.
John P.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk