viennagrid / viennagrid-dev

Developer repository for ViennaGrid. Visit http://viennagrid.sourceforge.net/ for the latest releases.
MIT License
15 stars 7 forks source link

Check dense_container_accessor_t::erase() #3

Closed karlrupp closed 11 years ago

karlrupp commented 11 years ago

Old version:

  if (element.id().get()-1 == container.size()) 
     container.erase( container.size()-1 );

Does this make any sense?

New version:

if (static_cast<size_type>(element.id().get()) == container.size() - 1)
  container.erase( container.size()-1 );

(silenced GCC warnings via static_cast) This makes more sense to me, yet I'm not sure whether this was the initial intention.

FlorianRudolf commented 11 years ago

Bug will be fixed in https://github.com/viennagrid/viennagrid-dev/issues/22 Same bug was present in ViennaData -> fixed