Skip to content

Commit

Permalink
fix(config_compiler): ambiguous operator overload with cmake option E…
Browse files Browse the repository at this point in the history
…NABLE_LOGGING=OFF

Fixes #211
  • Loading branch information
lotem committed Jul 2, 2018
1 parent 122893d commit b86b647
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/rime/config/config_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

namespace rime {

std::ostream& operator<< (std::ostream& stream, const Reference& reference) {
return stream << reference.repr();
}

std::ostream& operator<< (std::ostream& stream, const Dependency& dependency) {
return stream << dependency.repr();
}

struct ConfigDependencyGraph {
map<string, of<ConfigResource>> resources;
vector<of<ConfigItemRef>> node_stack;
Expand Down
6 changes: 2 additions & 4 deletions src/rime/config/config_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef RIME_CONFIG_COMPILER_H_
#define RIME_CONFIG_COMPILER_H_

#include <ostream>
#include <rime/common.h>
#include <rime/config/config_data.h>
#include <rime/config/config_types.h>
Expand Down Expand Up @@ -35,10 +36,7 @@ struct Reference {
string repr() const;
};

template <class StreamT>
StreamT& operator<< (StreamT& stream, const Reference& reference) {
return stream << reference.repr();
}
std::ostream& operator<< (std::ostream& stream, const Reference& reference);

class ConfigCompilerPlugin;
class ResourceResolver;
Expand Down
6 changes: 2 additions & 4 deletions src/rime/config/config_compiler_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef RIME_CONFIG_COMPILER_IMPL_H_
#define RIME_CONFIG_COMPILER_IMPL_H_

#include <ostream>
#include <rime/common.h>
#include <rime/config/config_compiler.h>
#include <rime/config/config_types.h>
Expand Down Expand Up @@ -32,10 +33,7 @@ struct Dependency {
virtual bool Resolve(ConfigCompiler* compiler) = 0;
};

template <class StreamT>
StreamT& operator<< (StreamT& stream, const Dependency& dependency) {
return stream << dependency.repr();
}
std::ostream& operator<< (std::ostream& stream, const Dependency& dependency);

struct PendingChild : Dependency {
string child_path;
Expand Down

0 comments on commit b86b647

Please sign in to comment.