Skip to content

Commit

Permalink
Fix issue Andersbakken#302. In gcc-4.7 this leads to the following er…
Browse files Browse the repository at this point in the history
…ror:

src/FileManager.cpp: In member function \u2018void FileManager::onFileRemoved(const Path&)\u2019:
src/FileManager.cpp:123:35: error: call of overloaded \u2018remove(const char*)\u2019 is ambiguous
src/FileManager.cpp:123:35: note: candidates are:
In file included from src/rct/rct/Path.h:9:0,
                 from src/FileManager.h:19,
                 from src/FileManager.cpp:16:
src/rct/rct/Set.h:25:10: note: bool Set<T>::remove(const T&) [with T = String]
src/rct/rct/Set.h:34:9: note: int Set<T>::remove(std::function<bool(const T&)>) [with T = String]

This is probably just a bug in gcc-4.7 but calling the function with a
String rather than a const char * fixes the problem.
  • Loading branch information
Andersbakken committed Mar 16, 2015
1 parent 68a18e6 commit 2a1fc56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void FileManager::onFileRemoved(const Path &path)
const Path parent = path.parentDir();
if (map.contains(parent)) {
Set<String> &dir = map[parent];
dir.remove(path.fileName());
dir.remove(String(path.fileName()));
if (dir.isEmpty()) {
mWatcher.unwatch(parent);
map.remove(parent);
Expand Down

0 comments on commit 2a1fc56

Please sign in to comment.