cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Strange / confusing code style

Open albert-github opened this issue 1 year ago • 2 comments
trafficstars

I saw a very strange coding style (strange place for the !) in "HalfedgeDS/include/CGAL/HalfedgeDS_const_decorator.h" around line 136

    while( e != hds->halfedges_end() && ! e->is_border() && !
           e->opposite()->is_border()) {

albert-github avatar Aug 06 '24 10:08 albert-github

Shall we grep for more trailing ! or just fix this one occurence ?

afabri avatar Sep 11 '24 07:09 afabri

I'd say always do a grep. I did a quick grep and looks like (to me) the following are also suspicious

  • BGL/include/CGAL/boost/graph/IO/3MF.h
      template<typename GraphRange>
    bool write_3MF(const std::string& filename,
                    const GraphRange& gs,
                  const std::vector<std::string>& names
    #ifndef DOXYGEN_RUNNING
                   , std::enable_if_t<!
                       internal::is_Point_set_or_Range_or_Iterator<
                         typename boost::range_value<GraphRange>::type>::value>* = nullptr
    #endif
                )
    
  • Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h
      if (!
         (eo >= 0 && eo < en && epr >= 0 && epr < en && ene >= 0 && ene < en &&
          v >= 0 && v < vn && f >= 0 && f < fn ))
    

albert-github avatar Sep 11 '24 08:09 albert-github