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.
This commit is contained in:
ArthurChamz 2014-06-04 19:00:41 -05:00
parent 44aa45cc4f
commit 4abb5a2af7
2 changed files with 4 additions and 4 deletions

View File

@ -620,7 +620,7 @@ namespace Clara {
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
{ {
if( other.m_floatingArg.get() ) 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 ) { CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
@ -649,7 +649,7 @@ namespace Clara {
ArgBuilder operator[]( UnpositionalTag ) { ArgBuilder operator[]( UnpositionalTag ) {
if( m_floatingArg.get() ) if( m_floatingArg.get() )
throw std::logic_error( "Only one unpositional argument can be added" ); 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() ); ArgBuilder builder( m_floatingArg.get() );
return builder; return builder;
} }

View File

@ -3630,7 +3630,7 @@ namespace Clara {
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
{ {
if( other.m_floatingArg.get() ) 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 ) { CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
@ -3658,7 +3658,7 @@ namespace Clara {
ArgBuilder operator[]( UnpositionalTag ) { ArgBuilder operator[]( UnpositionalTag ) {
if( m_floatingArg.get() ) if( m_floatingArg.get() )
throw std::logic_error( "Only one unpositional argument can be added" ); 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() ); ArgBuilder builder( m_floatingArg.get() );
return builder; return builder;
} }