Github user ben-craig commented on a diff in the pull request: https://github.com/apache/thrift/pull/357#discussion_r23161617 --- Diff: lib/cpp/src/thrift/protocol/THeaderProtocol.cpp --- @@ -0,0 +1,260 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +#ifndef THRIFT_PROTOCOL_THEADERPROTOCOL_CPP_ +#define THRIFT_PROTOCOL_THEADERPROTOCOL_CPP_ 1 + +#include <thrift/protocol/THeaderProtocol.h> +#include <thrift/protocol/TCompactProtocol.h> +#include <thrift/TApplicationException.h> + +#include <limits> +#include <boost/static_assert.hpp> + + +namespace apache { namespace thrift { namespace protocol { + +void THeaderProtocol::resetProtocol() { + if (proto_ && protoId_ == trans_->getProtocolId()) { + return; + } + + protoId_ = trans_->getProtocolId(); + + switch (protoId_) { + case T_BINARY_PROTOCOL: + proto_ = boost::shared_ptr<TProtocol>( --- End diff -- One of the many things I've been meaning to do is to make a big sweep over the cpp code and change boost::shared_ptr creations to use boost::make_shared. If you have time, you can make that change in your new files. If not, that is fine also. It can wait until someone goes through and changes them across the board.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---