Changes in src/Formula.cpp [426f2a:e5c0a1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Formula.cpp
r426f2a re5c0a1 47 47 for(const_iterator iter=end();iter!=begin();){ 48 48 --iter; 49 sstr << (*iter).first-> symbol;49 sstr << (*iter).first->getSymbol(); 50 50 if((*iter).second>1) 51 51 sstr << (*iter).second; … … 146 146 147 147 bool Formula::hasElement(const string &shorthand) const{ 148 element * element = World::getInstance().getPeriode()->FindElement(shorthand);148 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 149 149 return hasElement(element); 150 150 } … … 167 167 168 168 void Formula::operator+=(const string &shorthand){ 169 element * element = World::getInstance().getPeriode()->FindElement(shorthand);169 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 170 170 operator+=(element); 171 171 } … … 198 198 199 199 void Formula::operator-=(const string &shorthand){ 200 element * element = World::getInstance().getPeriode()->FindElement(shorthand);200 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 201 201 operator-=(element); 202 202 } … … 220 220 221 221 void Formula::addElements(const string &shorthand,unsigned int count){ 222 element * element = World::getInstance().getPeriode()->FindElement(shorthand);222 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 223 223 addElements(element,count); 224 224 } … … 252 252 253 253 const unsigned int Formula::operator[](string shorthand) const{ 254 element * element = World::getInstance().getPeriode()->FindElement(shorthand);254 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 255 255 return operator[](element); 256 256 } … … 380 380 result_type 381 381 Formula::_iterator<result_type>::operator*(){ 382 element *element = World::getInstance().getPeriode()->FindElement(pos+1);382 const element *element = World::getInstance().getPeriode()->FindElement(pos+1); 383 383 ASSERT(element,"Element with position of iterator not found"); 384 384 return make_pair(element,(*set)[pos]); … … 390 390 // no one can keep this value around, so a static is ok to avoid temporaries 391 391 static value_type value=make_pair(reinterpret_cast<element*>(0),0); // no default constructor for std::pair 392 element *element = World::getInstance().getPeriode()->FindElement(pos+1);392 const element *element = World::getInstance().getPeriode()->FindElement(pos+1); 393 393 ASSERT(element,"Element with position of iterator not found"); 394 394 value = make_pair(element,(*set)[pos]);
Note:
See TracChangeset
for help on using the changeset viewer.