From 4abb5a2af7bb8fc9cbf7ba04326ff7d2786029f4 Mon Sep 17 00:00:00 2001 From: ArthurChamz Date: Wed, 4 Jun 2014 19:00:41 -0500 Subject: [PATCH] Fix compilation error with old GCC versions. Compilation failed with GCC 4.3.3 under QNX 6.4.1. This use of auto_ptr's operator= is not supported. Change to reset() which has the same functionality with new pointers, applying to both auto_ptr and unique_ptr. --- include/external/clara.h | 4 ++-- single_include/catch.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/external/clara.h b/include/external/clara.h index d8e83ac5..eb471b73 100644 --- a/include/external/clara.h +++ b/include/external/clara.h @@ -620,7 +620,7 @@ namespace Clara { m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) { if( other.m_floatingArg.get() ) - m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) ); + m_floatingArg .reset( new Arg( *other.m_floatingArg ) ); } CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { @@ -649,7 +649,7 @@ namespace Clara { ArgBuilder operator[]( UnpositionalTag ) { if( m_floatingArg.get() ) throw std::logic_error( "Only one unpositional argument can be added" ); - m_floatingArg = ArgAutoPtr( new Arg() ); + m_floatingArg.reset( new Arg() ); ArgBuilder builder( m_floatingArg.get() ); return builder; } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 7f061ffe..61fcfc8f 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -3630,7 +3630,7 @@ namespace Clara { m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) { if( other.m_floatingArg.get() ) - m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) ); + m_floatingArg.reset( new Arg( *other.m_floatingArg ) ); } CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { @@ -3658,7 +3658,7 @@ namespace Clara { ArgBuilder operator[]( UnpositionalTag ) { if( m_floatingArg.get() ) throw std::logic_error( "Only one unpositional argument can be added" ); - m_floatingArg = ArgAutoPtr( new Arg() ); + m_floatingArg.reset( new Arg() ); ArgBuilder builder( m_floatingArg.get() ); return builder; }