mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
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:
parent
7d3df42bb5
commit
035aed90c0
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user