Index: include/xapian/weight.h
===================================================================
--- include/xapian/weight.h	(revision 13525)
+++ include/xapian/weight.h	(working copy)
@@ -71,6 +71,9 @@
     /// Don't allow assignment.
     void operator=(const Weight &);
 
+    /// Don't allow copying.
+    Weight(const Weight &);
+
     /// A bitmask of the statistics this weighting scheme needs.
     stat_flags stats_needed;
 
@@ -251,9 +254,6 @@
     }
 
   protected:
-    /// Only allow subclasses to copy us.
-    Weight(const Weight &);
-
     /// Default constructor, needed by subclass constructors.
     Weight() : stats_needed() { }
 
@@ -327,6 +327,8 @@
 
     Xapian::weight get_sumextra(Xapian::termcount doclen) const;
     Xapian::weight get_maxextra() const;
+
+    operator const Xapian::BoolWeight&() const { return *this; }
 };
 
 /// Xapian::Weight subclass implementing the BM25 probabilistic formula.
@@ -431,6 +433,8 @@
 
     Xapian::weight get_sumextra(Xapian::termcount doclen) const;
     Xapian::weight get_maxextra() const;
+
+    operator const Xapian::BM25Weight&() const { return *this; }
 };
 
 /** Xapian::Weight subclass implementing the traditional probabilistic formula.
@@ -491,6 +495,8 @@
 
     Xapian::weight get_sumextra(Xapian::termcount doclen) const;
     Xapian::weight get_maxextra() const;
+
+    operator const Xapian::TradWeight&() const { return *this; }
 };
 
 }
Index: tests/api_db.cc
===================================================================
--- tests/api_db.cc	(revision 13525)
+++ tests/api_db.cc	(working copy)
@@ -1898,6 +1898,8 @@
 
     Xapian::weight get_sumextra(Xapian::termcount) const { return 0; }
     Xapian::weight get_maxextra() const { return 0; }
+
+    operator const MyWeight&() const { return *this; }
 };
 
 // tests user weighting scheme.
