]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest-collision.cc
Issue 4550 (2/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / rest-collision.cc
index 300dcfc3c40d160238f8c4bcc3f00a55667916cb..1abd13646c26f4e36902befe001dd5ed0bdd65cf 100644 (file)
@@ -20,7 +20,6 @@
 #include "rest-collision.hh"
 
 #include <cmath>                // ceil.
-using namespace std;
 
 #include "directional-element-interface.hh"
 #include "duration.hh"
@@ -38,6 +37,8 @@ using namespace std;
 #include "warn.hh"
 #include "lily-imports.hh"
 
+using std::vector;
+
 MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Rest_collision, force_shift_callback_rest, 2, 1, "");
 SCM
 Rest_collision::force_shift_callback_rest (SCM rest, SCM offset)
@@ -52,7 +53,7 @@ Rest_collision::force_shift_callback_rest (SCM rest, SCM offset)
   if (scm_is_number (offset))
     rest_grob->translate_axis (scm_to_double (offset), Y_AXIS);
 
-  if (Note_column::has_interface (parent) && Note_column::has_rests (parent))
+  if (has_interface<Note_column> (parent) && Note_column::has_rests (parent))
     {
       Grob *collision = unsmob<Grob> (parent->get_object ("rest-collision"));
 
@@ -109,7 +110,7 @@ Rest_collision::calc_positioning_done (SCM smob)
   for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *e = elts[i];
-      if (Note_column::has_interface (e))
+      if (has_interface<Note_column> (e))
         {
           if (unsmob<Grob> (e->get_object ("rest")))
             rests.push_back (e);
@@ -254,7 +255,7 @@ Rest_collision::calc_positioning_done (SCM smob)
                 notedim.unite (notes[i]->extent (common, Y_AXIS));
             }
 
-          Real y = dir * max (0.0,
+          Real y = dir * std::max (0.0,
                               -dir * restdim[-dir] + dir * notedim[dir] + minimum_dist);
 
           // move discretely by half spaces.