This commit is contained in:
Daniel Sipka 2015-04-21 20:44:54 +02:00
parent 39cf0863e5
commit a30ae992d6
3 changed files with 6 additions and 7 deletions

View File

@ -22,9 +22,9 @@ namespace mstch {
} }
protected: protected:
template<class S> template<class S>
void register_methods(S* sub, std::map<std::string,N(S::*)()> methods) { void register_methods(S* s, std::map<std::string,N(S::*)()> methods) {
for(auto& item: methods) for(auto& i: methods)
this->methods.insert({item.first, std::bind(item.second, sub)}); this->methods.insert({i.first, std::bind(i.second, s)});
} }
private: private:
std::map<std::string, std::function<N()>> methods; std::map<std::string, std::function<N()>> methods;

View File

@ -44,9 +44,9 @@ const mstch::node& render_context::find_node(
token.substr(token.rfind('.') + 1), token.substr(token.rfind('.') + 1),
{find_node(token.substr(0, token.rfind('.')), current_nodes)}); {find_node(token.substr(0, token.rfind('.')), current_nodes)});
else else
for (auto& node: current_nodes) for (auto& i: current_nodes)
if (boost::apply_visitor(visitor::has_token(token), node)) if (boost::apply_visitor(visitor::has_token(token), i))
return boost::apply_visitor(visitor::get_token(token, node), node); return boost::apply_visitor(visitor::get_token(token, i), i);
return null_node; return null_node;
} }

View File

@ -8,7 +8,6 @@ namespace mstch {
namespace state { namespace state {
class render_state { class render_state {
public: public:
virtual ~render_state() {}
virtual std::string render( virtual std::string render(
render_context& context, const token& token) = 0; render_context& context, const token& token) = 0;
}; };