Browse Source

[trac80] Make it compile under g++

It seems g++ doesn't like to pass objects defined inside a function as a
template parameter somewhere. Taken out of the function.
Michal 'vorner' Vaner 14 years ago
parent
commit
ebba59e868
1 changed files with 9 additions and 8 deletions
  1. 9 8
      src/lib/datasrc/data_source.cc

+ 9 - 8
src/lib/datasrc/data_source.cc

@@ -49,20 +49,21 @@ using namespace isc::dns;
 using namespace isc::dns::rdata;
 
 namespace {
+
+struct MatchRRsetForType {
+    MatchRRsetForType(const RRType rrtype) : rrtype_(rrtype) {}
+    bool operator()(RRsetPtr rrset) {
+        return (rrset->getType() == rrtype_);
+    }
+    const RRType rrtype_;
+};
+
 // This is a helper to retrieve a specified RR type of RRset from RRsetList.
 // In our case the data source search logic should ensure that the class is
 // valid.  We use this find logic of our own so that we can support both
 // specific RR class queries (normal case) and class ANY queries.
 RRsetPtr
 findRRsetFromList(RRsetList& list, const RRType rrtype) {
-    struct MatchRRsetForType {
-        MatchRRsetForType(const RRType rrtype) : rrtype_(rrtype) {}
-        bool operator()(RRsetPtr rrset) {
-            return (rrset->getType() == rrtype_);
-        }
-        const RRType rrtype_;
-    };
-
     RRsetList::iterator it(find_if(list.begin(), list.end(),
                                    MatchRRsetForType(rrtype)));
     return (it != list.end() ? *it : RRsetPtr());