Rheolef  7.1
an efficient C++ finite element environment
load_chunk.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_LOAD_CHUNK_H
2 #define _RHEOLEF_LOAD_CHUNK_H
23 namespace rheolef {
24 template <class RandomIterator>
25 inline
26 bool
27 load_chunk (std::istream& s, RandomIterator iter, RandomIterator last)
28 {
29  while (iter != last)
30  if (!(s >> *iter++)) return false;
31  return s.good();
32 }
33 template <class RandomIterator, class GetFunction>
34 inline
35 bool
36 load_chunk (std::istream& s, RandomIterator iter, RandomIterator last, GetFunction get_element)
37 {
38  while (iter != last)
39  if (! get_element (s, *iter++)) return false;
40  return s.good();
41 }
42 } // namespace rheolef
43 #endif // _RHEOLEF_LOAD_CHUNK_H
This file is part of Rheolef.
bool load_chunk(std::istream &s, RandomIterator iter, RandomIterator last)
Definition: load_chunk.h:27