]> https://gitweb.dealii.org/ - dealii.git/commitdiff
better eof handling in CellId
authorTimo Heister <timo.heister@gmail.com>
Mon, 24 Jun 2013 13:23:19 +0000 (13:23 +0000)
committerTimo Heister <timo.heister@gmail.com>
Mon, 24 Jun 2013 13:23:19 +0000 (13:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@29873 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/cell_id.h

index 5dee60740f1da749d672d2308b286d417da0b1e0..16192ca3f418ab71e6c155e0640c006ec5482364 100644 (file)
@@ -77,7 +77,12 @@ inline std::ostream& operator<< (std::ostream& os, const CellId& cid)
  */
 inline std::istream& operator>> (std::istream& is, CellId& cid)
 {
-  is >> cid.coarse_cell_id;
+  unsigned int cellid;
+  is >> cellid;
+  if (is.eof())
+    return is;
+
+  cid.coarse_cell_id = cellid;
   char dummy;
   is >> dummy;
   Assert(dummy=='_', ExcMessage("invalid CellId"));

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.