From 325d810f5dade4e497dc3cd461e5b6d39ba5ecc6 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Thu, 10 Apr 2014 02:20:57 +0800 Subject: [PATCH] fix gcc build error about nested functor why? --- src/QtAV/factory.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/QtAV/factory.h b/src/QtAV/factory.h index e348eaa2..f05407ef 100644 --- a/src/QtAV/factory.h +++ b/src/QtAV/factory.h @@ -127,6 +127,12 @@ bool Factory::unregisterCreator(const ID& id) return creators.erase(id) == 1; } +// TODO: why gcc error if nested? +struct lower_equal { //: public std::binary_function { + bool operator()(char c1, char c2) const { + return ::tolower(c1) == ::tolower(c2); + } +}; template typename Factory::ID Factory::id(const std::string &name, bool caseSensitive) const { @@ -137,12 +143,6 @@ typename Factory::ID Factory::id(const std::string & if (it->second == name) return it->first; } else { - class lower_equal { - public: - bool operator()(char c1, char c2) { - return ::tolower(c1) == ::tolower(c2); - } - }; if (std::equal(name.begin(), name.end(), it->second.begin(), lower_equal())) { return it->first; }