package wfmath
tags 361815 + patch
thanks

It's looking like the change in parsing "template template parameters" was 
intentional, so I've written a patch to make wfmath compile with the new 
semantics.
-- 
Daniel Schepler
diff -urN wfmath-0.3.5.old/wfmath/axisbox.h wfmath-0.3.5/wfmath/axisbox.h
--- wfmath-0.3.5.old/wfmath/axisbox.h	2004-01-18 16:16:27.000000000 +0000
+++ wfmath-0.3.5/wfmath/axisbox.h	2007-06-29 22:54:52.000000000 +0000
@@ -51,12 +51,12 @@
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
 /// Get the axis-aligned bounding box for a set of boxes
-template<const int dim, template<class> class container>
-AxisBox<dim> BoundingBox(const container<AxisBox<dim> >& c);
+template<const int dim, template<class, class> class container>
+AxisBox<dim> BoundingBox(const container<AxisBox<dim>, std::allocator<AxisBox<dim> > >& c);
 
 /// Get the axis-aligned bounding box for a set of points
-template<const int dim, template<class> class container>
-AxisBox<dim> BoundingBox(const container<Point<dim> >& c);
+template<const int dim, template<class, class> class container>
+AxisBox<dim> BoundingBox(const container<Point<dim>, std::allocator<Point<dim> > >& c);
 #endif
 
 /// A dim dimensional axis-aligned box
diff -urN wfmath-0.3.5.old/wfmath/axisbox_funcs.h wfmath-0.3.5/wfmath/axisbox_funcs.h
--- wfmath-0.3.5.old/wfmath/axisbox_funcs.h	2004-01-18 16:16:27.000000000 +0000
+++ wfmath-0.3.5/wfmath/axisbox_funcs.h	2007-06-29 22:54:05.000000000 +0000
@@ -137,12 +137,12 @@
 
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
-template<const int dim, template<class> class container>
-AxisBox<dim> BoundingBox(const container<AxisBox<dim> >& c)
+template<const int dim, template<class, class> class container>
+AxisBox<dim> BoundingBox(const container<AxisBox<dim>, std::allocator<AxisBox<dim> > >& c)
 {
   // FIXME become friend
 
-  typename container<AxisBox<dim> >::const_iterator i = c.begin(), end = c.end();
+  typename container<AxisBox<dim>, std::allocator<AxisBox<dim> > >::const_iterator i = c.begin(), end = c.end();
 
   assert(i != end);
 
@@ -165,10 +165,10 @@
   return AxisBox<dim>(low, high, true);
 }
 
-template<const int dim, template<class> class container>
-AxisBox<dim> BoundingBox(const container<Point<dim> >& c)
+template<const int dim, template<class, class> class container>
+AxisBox<dim> BoundingBox(const container<Point<dim>, std::allocator<Point<dim> > >& c)
 {
-  typename container<Point<dim> >::const_iterator i = c.begin(), end = c.end();
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator i = c.begin(), end = c.end();
 
   assert(i != end);
 
diff -urN wfmath-0.3.5.old/wfmath/ball.h wfmath-0.3.5/wfmath/ball.h
--- wfmath-0.3.5.old/wfmath/ball.h	2004-02-05 16:24:23.000000000 +0000
+++ wfmath-0.3.5/wfmath/ball.h	2007-06-29 22:48:30.000000000 +0000
@@ -41,11 +41,11 @@
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
 /// get the minimal bounding sphere for a set of points
-template<const int dim, template<class> class container>
-Ball<dim> BoundingSphere(const container<Point<dim> >& c);
+template<const int dim, template<class, class> class container>
+Ball<dim> BoundingSphere(const container<Point<dim>, std::allocator<Point<dim> > >& c);
 /// get a bounding sphere for a set of points
-template<const int dim, template<class> class container>
-Ball<dim> BoundingSphereSloppy(const container<Point<dim> >& c);
+template<const int dim, template<class, class> class container>
+Ball<dim> BoundingSphereSloppy(const container<Point<dim>, std::allocator<Point<dim> > >& c);
 #endif
 
 template<const int dim>
diff -urN wfmath-0.3.5.old/wfmath/ball_funcs.h wfmath-0.3.5/wfmath/ball_funcs.h
--- wfmath-0.3.5.old/wfmath/ball_funcs.h	2003-08-08 18:31:50.000000000 +0000
+++ wfmath-0.3.5/wfmath/ball_funcs.h	2007-06-29 22:56:03.000000000 +0000
@@ -60,13 +60,13 @@
 }
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
-template<const int dim, template<class> class container>
-Ball<dim> BoundingSphere(const container<Point<dim> >& c)
+template<const int dim, template<class, class> class container>
+Ball<dim> BoundingSphere(const container<Point<dim>, std::allocator<Point<dim> > >& c)
 {
   _miniball::Miniball<dim> m;
   _miniball::Wrapped_array<dim> w;
 
-  typename container<Point<dim> >::const_iterator i, end = c.end();
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator i, end = c.end();
   bool valid = true;
 
   for(i = c.begin(); i != end; ++i) {
@@ -95,19 +95,19 @@
   return Ball<dim>(center, sqrt(m.squared_radius()));
 }
 
-template<const int dim, template<class> class container>
-Ball<dim> BoundingSphereSloppy(const container<Point<dim> >& c)
+template<const int dim, template<class, class> class container>
+Ball<dim> BoundingSphereSloppy(const container<Point<dim>, std::allocator<Point<dim> > >& c)
 {
   // This is based on the algorithm given by Jack Ritter
   // in Volume 2, Number 4 of Ray Tracing News
   // <http://www.acm.org/tog/resources/RTNews/html/rtnews7b.html>
 
-  typename container<Point<dim> >::const_iterator i = c.begin(),
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator i = c.begin(),
 						end = c.end();
   assert(i != end);
 
   CoordType min[dim], max[dim];
-  typename container<Point<dim> >::const_iterator min_p[dim], max_p[dim];
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator min_p[dim], max_p[dim];
   bool valid = i->isValid();
 
   for(int j = 0; j < dim; ++j) {
diff -urN wfmath-0.3.5.old/wfmath/point.h wfmath-0.3.5/wfmath/point.h
--- wfmath-0.3.5.old/wfmath/point.h	2006-08-15 23:49:32.000000000 +0000
+++ wfmath-0.3.5/wfmath/point.h	2007-06-29 22:56:46.000000000 +0000
@@ -63,8 +63,8 @@
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
 /// Find the center of a set of points, all weighted equally
-template<const int dim, template<class> class container>
-Point<dim> Barycenter(const container<Point<dim> >& c);
+template<const int dim, template<class, class> class container>
+Point<dim> Barycenter(const container<Point<dim>, std::allocator<Point<dim> > >& c);
 /// Find the center of a set of points with the given weights
 /**
  * If the number of points and the number of weights are not equal,
@@ -72,10 +72,10 @@
  * which is used, if there are more weights than points), must not
  * sum to zero.
  **/
-template<const int dim, template<class> class container,
-			template<class> class container2>
-Point<dim> Barycenter(const container<Point<dim> >& c,
-		      const container2<CoordType>& weights);
+template<const int dim, template<class, class> class container,
+			template<class, class> class container2>
+Point<dim> Barycenter(const container<Point<dim>, std::allocator<Point<dim> > >& c,
+		      const container2<CoordType, std::allocator<CoordType> >& weights);
 #endif
 
 // This is used a couple of places in the library
diff -urN wfmath-0.3.5.old/wfmath/point_funcs.h wfmath-0.3.5/wfmath/point_funcs.h
--- wfmath-0.3.5.old/wfmath/point_funcs.h	2006-08-15 23:49:32.000000000 +0000
+++ wfmath-0.3.5/wfmath/point_funcs.h	2007-06-29 22:52:49.000000000 +0000
@@ -157,15 +157,15 @@
 }
 
 #ifndef WFMATH_NO_TEMPLATES_AS_TEMPLATE_PARAMETERS
-template<const int dim, template<class> class container,
-			template<class> class container2>
-Point<dim> Barycenter(const container<Point<dim> >& c,
-		      const container2<CoordType>& weights)
+template<const int dim, template<class, class> class container,
+			template<class, class> class container2>
+Point<dim> Barycenter(const container<Point<dim>, std::allocator<Point<dim> > >& c,
+		      const container2<CoordType, std::allocator<CoordType> >& weights)
 {
   // FIXME become friend
 
-  typename container<Point<dim> >::const_iterator c_i = c.begin(), c_end = c.end();
-  typename container2<CoordType>::const_iterator w_i = weights.begin(),
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator c_i = c.begin(), c_end = c.end();
+  typename container2<CoordType, std::allocator<CoordType> >::const_iterator w_i = weights.begin(),
 						 w_end = weights.end();
 
   assert("nonempty list of points" && c_i != c_end);
@@ -201,12 +201,12 @@
   return out;
 }
 
-template<const int dim, template<class> class container>
-Point<dim> Barycenter(const container<Point<dim> >& c)
+template<const int dim, template<class, class> class container>
+Point<dim> Barycenter(const container<Point<dim>, std::allocator<Point<dim> > >& c)
 {
   // FIXME become friend
 
-  typename container<Point<dim> >::const_iterator i = c.begin(), end = c.end();
+  typename container<Point<dim>, std::allocator<Point<dim> > >::const_iterator i = c.begin(), end = c.end();
 
   assert("nonempty list of points" && i != end);
 

Reply via email to