]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
core:" Stringify needs access to << before reference" src/include/stringify.h
authorWillem Jan Withagen <wjw@digiware.nl>
Fri, 14 Jul 2017 08:44:44 +0000 (10:44 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Fri, 14 Jul 2017 08:44:44 +0000 (10:44 +0200)
Clang complains:

In file included from /home/jenkins/workspace/ceph-master/src/mon/HealthMonitor.cc:21:
/home/jenkins/workspace/ceph-master/src/include/stringify.h:15:6: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup
  ss << a;
     ^
/home/jenkins/workspace/ceph-master/src/mon/HealthMonitor.cc:129:32: note: in instantiation of function template specialization 'stringify<std::__1::set<std::__1::basic_string<char>, std::__1::less<std::__1::basic_string<char> >, std::__1::allocator<std::__1::basic_string<char> > > >' requested here
      boost::regex("%names%"), stringify(names[p.first]));
                               ^
/home/jenkins/workspace/ceph-master/src/include/types.h:160:17: note: 'operator<<' should be declared prior to the call site
inline ostream& operator<<(ostream& out, const set<A, Comp, Alloc>& iset) {

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/include/stringify.h

index d7b90ed2c909413af2c27c1af5ab17902442c882..1b2a130c9301d0764bf6cf1cfcc1e62f38843ecc 100644 (file)
@@ -4,6 +4,8 @@
 #include <string>
 #include <sstream>
 
+#include "include/types.h"
+
 template<typename T>
 inline std::string stringify(const T& a) {
 #if defined(__GNUC__) && !(defined(__clang__) || defined(__INTEL_COMPILER))