mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Use reset instead of assignment when updating auto_ptr/unique_ptr
This commit is contained in:
parent
b1936d3b0e
commit
4b3fa4742b
4
include/external/clara.h
vendored
4
include/external/clara.h
vendored
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user