Fix libcxx build.
In libcxx, vector<bool>::const_reference is not the same as bool. This requires a new specialization of ParamTraits. BUG=178409 R=tsepez@chromium.org,agl@chromium.org Review URL: https://chromiumcodereview.appspot.com/12943006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189383 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -404,8 +404,11 @@ void ParamTraits<std::vector<unsigned char> >::Log(const param_type& p,
|
||||
|
||||
void ParamTraits<std::vector<bool> >::Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, static_cast<int>(p.size()));
|
||||
// Cast to bool below is required because libc++'s
|
||||
// vector<bool>::const_reference is different from bool, and we want to avoid
|
||||
// writing an extra specialization of ParamTraits for it.
|
||||
for (size_t i = 0; i < p.size(); i++)
|
||||
WriteParam(m, p[i]);
|
||||
WriteParam(m, static_cast<bool>(p[i]));
|
||||
}
|
||||
|
||||
bool ParamTraits<std::vector<bool> >::Read(const Message* m,
|
||||
@ -429,7 +432,7 @@ void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) {
|
||||
for (size_t i = 0; i < p.size(); ++i) {
|
||||
if (i != 0)
|
||||
l->push_back(' ');
|
||||
LogParam((p[i]), l);
|
||||
LogParam(static_cast<bool>(p[i]), l);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user