You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2009/02/10 22:38:48 UTC

svn commit: r743112 - /incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h

Author: dreiss
Date: Tue Feb 10 21:38:48 2009
New Revision: 743112

URL: http://svn.apache.org/viewvc?rev=743112&view=rev
Log:
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.

Modified:
    incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h

Modified: incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h?rev=743112&r1=743111&r2=743112&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/protocol/TProtocol.h Tue Feb 10 21:38:48 2009
@@ -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.
    */