Hold exception translators by unique_ptr

- and removed range deleters
This commit is contained in:
Phil Nash
2017-07-20 23:50:07 +01:00
parent cb6963216f
commit 46bf7605f4
4 changed files with 5 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ namespace Catch {
typedef std::string(*exceptionTranslateFunction)();
struct IExceptionTranslator;
typedef std::vector<const IExceptionTranslator*> ExceptionTranslators;
typedef std::vector<std::unique_ptr<IExceptionTranslator const>> ExceptionTranslators;
struct IExceptionTranslator {
virtual ~IExceptionTranslator();
@@ -40,7 +40,7 @@ namespace Catch {
: m_translateFunction( translateFunction )
{}
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
try {
if( it == itEnd )
throw;