mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Converted a load of spelt out iterators to auto
This commit is contained in:
@@ -120,7 +120,7 @@ namespace Catch {
|
||||
node = m_rootSection;
|
||||
} else {
|
||||
SectionNode& parentNode = *m_sectionStack.back();
|
||||
SectionNode::ChildSections::const_iterator it =
|
||||
auto it =
|
||||
std::find_if(parentNode.childSections.begin(),
|
||||
parentNode.childSections.end(),
|
||||
BySectionInfo(sectionInfo));
|
||||
|
@@ -217,7 +217,7 @@ namespace Catch {
|
||||
if ( itMessage == messages.end() )
|
||||
return;
|
||||
|
||||
// using messages.end() directly yields compilation error:
|
||||
// using messages.end() directly yields (or auto) compilation error:
|
||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
|
||||
|
@@ -274,7 +274,7 @@ namespace Catch {
|
||||
if( m_sectionStack.size() > 1 ) {
|
||||
Colour colourGuard( Colour::Headers );
|
||||
|
||||
std::vector<SectionInfo>::const_iterator
|
||||
auto
|
||||
it = m_sectionStack.begin()+1, // Skip first section (test case)
|
||||
itEnd = m_sectionStack.end();
|
||||
for( ; it != itEnd; ++it )
|
||||
|
@@ -205,7 +205,7 @@ namespace Catch {
|
||||
return;
|
||||
}
|
||||
|
||||
// using messages.end() directly yields compilation error:
|
||||
// using messages.end() directly (or auto) yields compilation error:
|
||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
|
||||
|
Reference in New Issue
Block a user