Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion example/plugins/cpp-api/boom/boom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,16 @@ GlobalPlugin *plugin;
// Functor that decides whether the HTTP error can be rewritten or not.
// Rewritable codes are: 2xx, 3xx, 4xx, 5xx and 6xx.
// 1xx is NOT rewritable!
class IsRewritableCode : public std::unary_function<std::string, bool>
class IsRewritableCode
{ // could probably be replaced with mem_ptr_fun()..
private:
int current_code_;
std::string current_code_string_;

public:
using argument_type = std::string;
using result_type = bool;

explicit IsRewritableCode(int current_code) : current_code_(current_code)
{
std::ostringstream oss;
Expand Down
6 changes: 5 additions & 1 deletion include/tscore/IntrusivePtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,13 @@ template <typename T> class IntrusivePtrDefaultPolicy
static void finalize(T *t);

/// Strict weak order for STL containers.
class Order : public std::binary_function<IntrusivePtr<T>, IntrusivePtr<T>, bool>
class Order
{
public:
using first_argument_type = IntrusivePtr<T>;
using second_argument_type = IntrusivePtr<T>;
using result_type = bool;

/// Default constructor.
Order() {}
/// Compare by raw pointer.
Expand Down
10 changes: 8 additions & 2 deletions include/tscpp/api/Headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ class HeaderField;
/**
* @brief A header field value iterator iterates through all header fields.
*/
class header_field_value_iterator : public std::iterator<std::forward_iterator_tag, int>
class header_field_value_iterator
{
private:
HeaderFieldValueIteratorState *state_;

public:
using iterator_category = std::forward_iterator_tag;
using value_type = int;

/**
* Constructor for header_field_value_iterator, this shouldn't need to be used directly.
* @param bufp the TSMBuffer associated with the headers
Expand Down Expand Up @@ -169,13 +172,16 @@ class header_field_value_iterator : public std::iterator<std::forward_iterator_t
/**
* @brief A header field iterator is an iterator that dereferences to a HeaderField.
*/
class header_field_iterator : public std::iterator<std::forward_iterator_tag, int>
class header_field_iterator
{
private:
HeaderFieldIteratorState *state_;
header_field_iterator(void *hdr_buf, void *hdr_loc, void *field_loc);

public:
using iterator_category = std::forward_iterator_tag;
using value_type = int;

~header_field_iterator();

/**
Expand Down
5 changes: 4 additions & 1 deletion iocore/net/quic/QUICFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,12 @@ class QUICAckFrame : public QUICFrame
class AckBlockSection
{
public:
class const_iterator : public std::iterator<std::input_iterator_tag, QUICAckFrame::AckBlock>
class const_iterator
{
public:
using iterator_category = std::input_iterator_tag;
using value_type = QUICAckFrame::AckBlock;

const_iterator(uint8_t index, const std::vector<QUICAckFrame::AckBlock> *ack_blocks);

const QUICAckFrame::AckBlock &
Expand Down
2 changes: 0 additions & 2 deletions iocore/net/quic/QUICVersionNegotiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ QUICVersionNegotiator::negotiate(const QUICPacket &packet)
case QUICPacketType::VERSION_NEGOTIATION: {
const QUICVersionNegotiationPacketR &vn_packet = static_cast<const QUICVersionNegotiationPacketR &>(packet);
uint16_t n_supported_version = vn_packet.nversions();
uint16_t len = 0;

for (int i = 0; i < n_supported_version; ++i) {
QUICVersion version = vn_packet.supported_version(i);
len += sizeof(QUICVersion);

if (QUICTypeUtil::is_supported_version(version)) {
this->_status = QUICVersionNegotiationStatus::NEGOTIATED;
Expand Down
6 changes: 5 additions & 1 deletion src/tscore/HostLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ struct CharIndexBlock {
class CharIndex
{
public:
struct iterator : public std::iterator<std::forward_iterator_tag, HostBranch, int> {
struct iterator {
using iterator_category = std::forward_iterator_tag;
using value_type = HostBranch;
using difference_type = int;

using self_type = iterator;

struct State {
Expand Down
6 changes: 5 additions & 1 deletion src/wccp/WccpMeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ template <bool VALUE> struct TEST_IF_TRUE : public TEST_RESULT<TEST_BOOL<VALUE>>
};

// Helper for assigning a value to all instances in a container.
template <typename T, typename R, typename A1> struct TsAssignMember : public std::binary_function<T, A1, R> {
template <typename T, typename R, typename A1> struct TsAssignMember {
using first_argument_type = T;
using second_argument_type = A1;
using result_type = R;

R T::*_m;
A1 _arg1;
TsAssignMember(R T::*m, A1 const &arg1) : _m(m), _arg1(arg1) {}
Expand Down