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:
template<class S>
void register_methods(S* sub, std::map<std::string,N(S::*)()> methods) {
for(auto& item: methods)
this->methods.insert({item.first, std::bind(item.second, sub)});
void register_methods(S* s, std::map<std::string,N(S::*)()> methods) {
for(auto& i: methods)
this->methods.insert({i.first, std::bind(i.second, s)});
}
private:
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),
{find_node(token.substr(0, token.rfind('.')), current_nodes)});
else
for (auto& node: current_nodes)
if (boost::apply_visitor(visitor::has_token(token), node))
return boost::apply_visitor(visitor::get_token(token, node), node);
for (auto& i: current_nodes)
if (boost::apply_visitor(visitor::has_token(token), i))
return boost::apply_visitor(visitor::get_token(token, i), i);
return null_node;
}

View file

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