cgal/Kinetic_data_structures/examples/Kinetic_data_structures
Laurent Rineau 269ae1ca61 Fix the uses of std::basic_ios::bad(), and use fail() instead.
bad() implies fail() but std::basic_ios::operator! is actually equivalent
to std::basic_ios::fail(), not bad().

For example,
    std::ifstream is(argv[1]);
    if (is.bad()) {
is probably wrong because, in case the file does not exist, only the failbit it set,
and not the badbit.

Other example:
   double x;
   is >> x;
If the stream 'is' does not contains a string that can represent a double,
then failbit is set (and maybe the eofbit if the stream is actually too
short), but not the badbit.

bad() can be used, in case fail() returned true, to discriminate between a
I/O error and a logical error.

See:
  http://en.cppreference.com/w/cpp/io/basic_ios/operator_bool
  http://en.cppreference.com/w/cpp/io/ios_base/iostate
2013-12-12 16:13:40 +01:00
..
data
Kinetic_Delaunay_triangulation_2.cpp Fix warnings 2013-02-07 18:15:23 +01:00
Kinetic_Delaunay_triangulation_3.cpp Remove semi-colon after main() function definition. 2009-12-12 14:32:20 +00:00
Kinetic_insert_event.cpp Remove semi-colon after main() function definition. 2009-12-12 14:32:20 +00:00
Kinetic_regular_triangulation_3.cpp Fix the uses of std::basic_ios::bad(), and use fail() instead. 2013-12-12 16:13:40 +01:00
Kinetic_sort.cpp Fix warnings 2013-02-07 18:15:23 +01:00
Kinetic_sweepline.cpp Renamed examples in order to get unique names 2008-12-12 10:54:06 +00:00