code cleanup

This commit is contained in:
Artem Pavlenko 2006-03-22 20:31:02 +00:00
parent 1ae34ab1d5
commit 6f1ed0029c

View file

@ -350,9 +350,7 @@ namespace mapnik {
friend const value operator-(value const&,value const&); friend const value operator-(value const&,value const&);
friend const value operator*(value const&,value const&); friend const value operator*(value const&,value const&);
friend const value operator/(value const&,value const&); friend const value operator/(value const&,value const&);
//friend template <typename charT, typename traits>
// std::basic_ostream<charT,traits>& operator << (std::basic_ostream<charT,traits>&,
// value const& );
public: public:
value () value ()
: base_(0) {} : base_(0) {}
@ -360,16 +358,6 @@ namespace mapnik {
template <typename T> value(T _val_) template <typename T> value(T _val_)
: base_(_val_) {} : base_(_val_) {}
//value (std::string const& str)
// : base(str) {}
//value& operator=(value const& rhs)
//{
// if (this == &rhs)
// return *this;
// //TODO!!!!!
// return *this;
//}
bool operator==(value const& other) const bool operator==(value const& other) const
{ {
return boost::apply_visitor(impl::equals(),base_,other.base_); return boost::apply_visitor(impl::equals(),base_,other.base_);
@ -403,31 +391,7 @@ namespace mapnik {
{ {
return base_; return base_;
} }
/*
value& operator+=(value const& other)
{
*this = boost::apply_visitor(impl::add<value>(),*this,other);
return *this;
}
value& operator-=(value const& other)
{
*this = boost::apply_visitor(impl::sub<value>(),*this,other);
return *this;
}
value& operator*=(value const& other)
{
*this = boost::apply_visitor(impl::mult<value>(),*this,other);
return *this;
}
value& operator/=(value const& other)
{
*this = boost::apply_visitor(impl::div<value>(),*this,other);
return *this;
}
*/
std::string to_expression_string() const std::string to_expression_string() const
{ {
return boost::apply_visitor(impl::to_expression_string(),base_); return boost::apply_visitor(impl::to_expression_string(),base_);
@ -441,33 +405,25 @@ namespace mapnik {
inline const value operator+(value const& p1,value const& p2) inline const value operator+(value const& p1,value const& p2)
{ {
//value tmp(p1);
//tmp+=p2;
//return tmp;
return value(boost::apply_visitor(impl::add<value>(),p1.base_, p2.base_)); return value(boost::apply_visitor(impl::add<value>(),p1.base_, p2.base_));
} }
inline const value operator-(value const& p1,value const& p2) inline const value operator-(value const& p1,value const& p2)
{ {
//value tmp(p1);
//tmp-=p2;
//return tmp;
return value(boost::apply_visitor(impl::sub<value>(),p1.base_, p2.base_)); return value(boost::apply_visitor(impl::sub<value>(),p1.base_, p2.base_));
} }
inline const value operator*(value const& p1,value const& p2) inline const value operator*(value const& p1,value const& p2)
{ {
//value tmp(p1);
//tmp*=p2;
//return tmp;
return value(boost::apply_visitor(impl::mult<value>(),p1.base_, p2.base_)); return value(boost::apply_visitor(impl::mult<value>(),p1.base_, p2.base_));
} }
inline const value operator/(value const& p1,value const& p2) inline const value operator/(value const& p1,value const& p2)
{ {
//value tmp(p1);
//tmp/=p2;
//return tmp;
return value(boost::apply_visitor(impl::div<value>(),p1.base_, p2.base_)); return value(boost::apply_visitor(impl::div<value>(),p1.base_, p2.base_));
} }