diff options
-rw-r--r-- | configure.in | 19 | ||||
-rw-r--r-- | src/media_library.cpp | 4 | ||||
-rw-r--r-- | src/mutable_song.cpp | 22 |
3 files changed, 28 insertions, 17 deletions
diff --git a/configure.in b/configure.in index 122cc83f..eab92915 100644 --- a/configure.in +++ b/configure.in @@ -36,7 +36,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]])], AC_MSG_RESULT([yes]) std_cpp0x="-std=c++0x", AC_MSG_RESULT([no]) - AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.5)]]) + AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.6)]]) ) CXXFLAGS="$old_CXXFLAGS $std_cpp0x" @@ -47,7 +47,7 @@ AC_MSG_CHECKING([whether compiler supports initializer lists]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <vector>], [[std::vector<int> test = { 1, 2, 3 }; test.push_back(4);]])], AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) - AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.5)]]) + AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.6)]]) ) dnl ===================================== @@ -57,7 +57,7 @@ AC_MSG_CHECKING([whether compiler supports auto keyword]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[auto test = new int; *test = 1;]])], AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) - AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.5)]]) + AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.6)]]) ) dnl ========================================= @@ -67,7 +67,18 @@ AC_MSG_CHECKING([whether compiler supports lambda functions]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[int a = 5; std::function<int(int)> f = [&a](int b) { return a + b; }; f(8);]])], AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) - AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.5)]]) + AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.6)]]) +) + +dnl ================================================================ +dnl = checking whether calling derived member function of object = +dnl = passed to lambda without explicit 'this' usage works = +dnl ================================================================ +AC_MSG_CHECKING([whether calling derived member function passed to lambda without explicit this usage works ]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[struct A { void foo() { } }; struct B : public A { void bar() { std::function<void()> f = [this]() { foo(); }; f(); } } foo; foo.bar();]])], + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + AC_MSG_ERROR([[Your compiler doesn't seem to support calling derived member function of an object passed to lambda as 'this' without explicit 'this' usage, please upgrade (GCC >= 4.6)]]) ) dnl ========================================= diff --git a/src/media_library.cpp b/src/media_library.cpp index 99089f94..81580f56 100644 --- a/src/media_library.cpp +++ b/src/media_library.cpp @@ -453,7 +453,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me) { auto tryNextColumn = [this]() -> bool { bool result = true; - if (this->isActiveWindow(Songs)) + if (isActiveWindow(Songs)) { if (nextColumnAvailable()) nextColumn(); @@ -464,7 +464,7 @@ void MediaLibrary::mouseButtonPressed(MEVENT me) }; auto tryPreviousColumn = [this]() -> bool { bool result = true; - if (this->isActiveWindow(Tags)) + if (isActiveWindow(Tags)) { if (previousColumnAvailable()) previousColumn(); diff --git a/src/mutable_song.cpp b/src/mutable_song.cpp index 761d41e4..3eb0c0b1 100644 --- a/src/mutable_song.cpp +++ b/src/mutable_song.cpp @@ -25,27 +25,27 @@ namespace MPD {// std::string MutableSong::getArtist(unsigned idx) const { - return getTag(MPD_TAG_ARTIST, [this, idx](){ return this->Song::getArtist(idx); }, idx); + return getTag(MPD_TAG_ARTIST, [this, idx](){ return Song::getArtist(idx); }, idx); } std::string MutableSong::getTitle(unsigned idx) const { - return getTag(MPD_TAG_TITLE, [this, idx](){ return this->Song::getTitle(idx); }, idx); + return getTag(MPD_TAG_TITLE, [this, idx](){ return Song::getTitle(idx); }, idx); } std::string MutableSong::getAlbum(unsigned idx) const { - return getTag(MPD_TAG_ALBUM, [this, idx](){ return this->Song::getAlbum(idx); }, idx); + return getTag(MPD_TAG_ALBUM, [this, idx](){ return Song::getAlbum(idx); }, idx); } std::string MutableSong::getAlbumArtist(unsigned idx) const { - return getTag(MPD_TAG_ALBUM_ARTIST, [this, idx](){ return this->Song::getAlbumArtist(idx); }, idx); + return getTag(MPD_TAG_ALBUM_ARTIST, [this, idx](){ return Song::getAlbumArtist(idx); }, idx); } std::string MutableSong::getTrack(unsigned idx) const { - std::string track = getTag(MPD_TAG_TRACK, [this, idx](){ return this->Song::getTrack(idx); }, idx); + std::string track = getTag(MPD_TAG_TRACK, [this, idx](){ return Song::getTrack(idx); }, idx); if ((track.length() == 1 && track[0] != '0') || (track.length() > 3 && track[1] == '/')) return "0"+track; @@ -55,32 +55,32 @@ std::string MutableSong::getTrack(unsigned idx) const std::string MutableSong::getDate(unsigned idx) const { - return getTag(MPD_TAG_DATE, [this, idx](){ return this->Song::getDate(idx); }, idx); + return getTag(MPD_TAG_DATE, [this, idx](){ return Song::getDate(idx); }, idx); } std::string MutableSong::getGenre(unsigned idx) const { - return getTag(MPD_TAG_GENRE, [this, idx](){ return this->Song::getGenre(idx); }, idx); + return getTag(MPD_TAG_GENRE, [this, idx](){ return Song::getGenre(idx); }, idx); } std::string MutableSong::getComposer(unsigned idx) const { - return getTag(MPD_TAG_COMPOSER, [this, idx](){ return this->Song::getComposer(idx); }, idx); + return getTag(MPD_TAG_COMPOSER, [this, idx](){ return Song::getComposer(idx); }, idx); } std::string MutableSong::getPerformer(unsigned idx) const { - return getTag(MPD_TAG_PERFORMER, [this, idx](){ return this->Song::getPerformer(idx); }, idx); + return getTag(MPD_TAG_PERFORMER, [this, idx](){ return Song::getPerformer(idx); }, idx); } std::string MutableSong::getDisc(unsigned idx) const { - return getTag(MPD_TAG_DISC, [this, idx](){ return this->Song::getDisc(idx); }, idx); + return getTag(MPD_TAG_DISC, [this, idx](){ return Song::getDisc(idx); }, idx); } std::string MutableSong::getComment(unsigned idx) const { - return getTag(MPD_TAG_COMMENT, [this, idx](){ return this->Song::getComment(idx); }, idx); + return getTag(MPD_TAG_COMMENT, [this, idx](){ return Song::getComment(idx); }, idx); } void MutableSong::setArtist(const std::string &value, unsigned idx) |