manual range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
a62950ed60
commit
b789bb009c
@ -16,8 +16,8 @@ namespace YAML {
|
||||
template <typename Seq>
|
||||
inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) {
|
||||
emitter << BeginSeq;
|
||||
for (typename Seq::const_iterator it = seq.begin(); it != seq.end(); ++it)
|
||||
emitter << *it;
|
||||
for (const auto& emit : seq)
|
||||
emitter << emit;
|
||||
emitter << EndSeq;
|
||||
return emitter;
|
||||
}
|
||||
@ -41,8 +41,8 @@ template <typename K, typename V>
|
||||
inline Emitter& operator<<(Emitter& emitter, const std::map<K, V>& m) {
|
||||
typedef typename std::map<K, V> map;
|
||||
emitter << BeginMap;
|
||||
for (typename map::const_iterator it = m.begin(); it != m.end(); ++it)
|
||||
emitter << Key << it->first << Value << it->second;
|
||||
for (const auto& emit : m)
|
||||
emitter << Key << emit.first << Value << emit.second;
|
||||
emitter << EndMap;
|
||||
return emitter;
|
||||
}
|
||||
|
||||
@ -83,9 +83,8 @@ class SettingChanges {
|
||||
}
|
||||
|
||||
void restore() YAML_CPP_NOEXCEPT {
|
||||
for (setting_changes::const_iterator it = m_settingChanges.begin();
|
||||
it != m_settingChanges.end(); ++it)
|
||||
(*it)->pop();
|
||||
for (const auto& setting : m_settingChanges)
|
||||
setting->pop();
|
||||
}
|
||||
|
||||
void push(std::unique_ptr<SettingChangeBase> pSettingChange) {
|
||||
|
||||
@ -254,7 +254,7 @@ TEST(NodeTest, IncompleteJson) {
|
||||
{"JSON map without end brace", "{\"access\":\"abc\"",
|
||||
ErrorMsg::END_OF_MAP_FLOW},
|
||||
};
|
||||
for (const ParserExceptionTestCase test : tests) {
|
||||
for (const ParserExceptionTestCase& test : tests) {
|
||||
try {
|
||||
Load(test.input);
|
||||
FAIL() << "Expected exception " << test.expected_exception << " for "
|
||||
|
||||
Loading…
Reference in New Issue
Block a user