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
This commit is contained in:
David Reiss 2009-02-10 21:38:48 +00:00
parent 7d3df42bb5
commit 035aed90c0

View File

@ -213,6 +213,12 @@ class TProtocol {
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.
*/