+ return bvalue by const ref

+ feature impl update
This commit is contained in:
Artem Pavlenko 2012-01-12 09:35:57 +00:00
parent 657cfa20d3
commit cb070f7b1d

View file

@ -30,8 +30,6 @@
namespace mapnik { namespace mapnik {
static mapnik::value _null_value;
struct attribute struct attribute
{ {
std::string name_; std::string name_;
@ -39,16 +37,11 @@ struct attribute
: name_(name) {} : name_(name) {}
template <typename V ,typename F> template <typename V ,typename F>
V value(F const& f) const V const& value(F const& f) const
{ {
typedef typename F::const_iterator const_iterator; return f.get(name_);
const_iterator itr = f.find(name_);
if (itr != f.end())
{
return itr->second;
}
return _null_value;
} }
std::string const& name() const { return name_;} std::string const& name() const { return name_;}
}; };
} }