cpp: Fix implementations of "list<bool>"

TProtocol::readBool expects a "bool&" as its argument, but "list<bool>"
is implemented as "vector<bool>", which is a specialization of vector
that uses a custom structure as its reference type.  Therefore, we need
to overload TProtocol::readBool for std::vector<bool>::reference.
This function is provided as a non-virtual for efficiency since it is
highly unlikely that any subclass will want to override it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743112 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index e4cfe0f..5dcea2b 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -213,6 +213,12 @@
 
   virtual uint32_t readBinary(std::string& str) = 0;
 
+  uint32_t readBool(std::vector<bool>::reference ref) {
+    bool value;
+    uint32_t rv = readBool(value);
+    ref = value;
+  }
+
   /**
    * Method to arbitrarily skip over data.
    */