mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Use reset instead of assignment when updating auto_ptr/unique_ptr
This commit is contained in:
		
							
								
								
									
										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; | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash