Skip to content

Commit

Permalink
Fix compilation for Qt-projects
Browse files Browse the repository at this point in the history
Not use 'emit' as variable name, in Qt Framework it reserved word
  • Loading branch information
hkarel committed Jul 14, 2020
1 parent c82d312 commit cb58470
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/yaml-cpp/stlemitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ namespace YAML {
template <typename Seq>
inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) {
emitter << BeginSeq;
for (const auto& emit : seq)
emitter << emit;
// Not use 'emit' as variable name, in Qt Framework it reserved word
for (const auto& emit_ : seq)
emitter << emit_;
emitter << EndSeq;
return emitter;
}
Expand All @@ -40,8 +41,9 @@ inline Emitter& operator<<(Emitter& emitter, const std::set<T>& v) {
template <typename K, typename V>
inline Emitter& operator<<(Emitter& emitter, const std::map<K, V>& m) {
emitter << BeginMap;
for (const auto& emit : m)
emitter << Key << emit.first << Value << emit.second;
// Not use 'emit' as variable name, in Qt Framework it reserved word
for (const auto& emit_ : m)
emitter << Key << emit_.first << Value << emit_.second;
emitter << EndMap;
return emitter;
}
Expand Down

0 comments on commit cb58470

Please sign in to comment.