Skip to content

Commit

Permalink
AVRO-4101: [C++] Remove boost::{blank,function,shared_ptr,static_asse…
Browse files Browse the repository at this point in the history
…rt,utility} (#3272)
  • Loading branch information
wgtmac authored Dec 29, 2024
1 parent 34ce192 commit 25831a6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 18 deletions.
1 change: 0 additions & 1 deletion lang/c++/impl/json/JsonIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/utility.hpp>
#include <locale>
#include <sstream>
#include <stack>
Expand Down
3 changes: 1 addition & 2 deletions lang/c++/include/avro/DataFile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
#include "ValidSchema.hh"
#include "buffer/Buffer.hh"

#include <array>
#include <map>
#include <string>
#include <vector>

#include "array"
#include "boost/utility.hpp"
#include <boost/iostreams/filtering_stream.hpp>

namespace avro {
Expand Down
2 changes: 0 additions & 2 deletions lang/c++/include/avro/Generic.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#ifndef avro_Generic_hh__
#define avro_Generic_hh__

#include <boost/utility.hpp>

#include "Config.hh"
#include "Decoder.hh"
#include "Encoder.hh"
Expand Down
3 changes: 2 additions & 1 deletion lang/c++/include/avro/Specific.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
*/
namespace avro {

typedef boost::blank null;
struct null {
};

template<typename T>
void encode(Encoder &e, const T &t);
Expand Down
2 changes: 0 additions & 2 deletions lang/c++/include/avro/Stream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <memory>
#include <vector>

#include "boost/utility.hpp"

#include "Config.hh"
#include "Exception.hh"

Expand Down
16 changes: 6 additions & 10 deletions lang/c++/include/avro/buffer/detail/BufferDetail.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
#ifndef avro_BufferDetail_hh__
#define avro_BufferDetail_hh__

#include <boost/function.hpp>
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/utility.hpp>
#include <utility>
#ifdef HAVE_BOOST_ASIO
#include <boost/asio/buffer.hpp>
#endif
#include <cassert>
#include <deque>
#include <exception>
#include <utility>

/**
* \file BufferDetail.hh
Expand All @@ -55,7 +51,7 @@ const size_type kMinBlockSize = 4096;
const size_type kMaxBlockSize = 16384;
const size_type kDefaultBlockSize = kMinBlockSize;

typedef boost::function<void(void)> free_func;
typedef std::function<void(void)> free_func;

/**
* Simple class to hold a functor that executes on delete
Expand Down Expand Up @@ -108,7 +104,7 @@ public:

private:
// reference counted object will call a functor when it's destroyed
boost::shared_ptr<CallOnDestroy> callOnDestroy_;
std::shared_ptr<CallOnDestroy> callOnDestroy_;

public:
/// Remove readable bytes from the front of the chunk by advancing the
Expand Down Expand Up @@ -274,8 +270,8 @@ class BufferImpl {

public:
typedef std::deque<Chunk> ChunkList;
typedef boost::shared_ptr<BufferImpl> SharedPtr;
typedef boost::shared_ptr<const BufferImpl> ConstSharedPtr;
typedef std::shared_ptr<BufferImpl> SharedPtr;
typedef std::shared_ptr<const BufferImpl> ConstSharedPtr;

/// Default constructor, creates a buffer without any chunks
BufferImpl() : freeSpace_(0),
Expand Down Expand Up @@ -343,7 +339,7 @@ public:
/// and will compile-time assert.
template<typename T>
void writeTo(T /*val*/, const std::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0);
}

/// Write a block of data to the buffer, adding new chunks if necessary.
Expand Down

0 comments on commit 25831a6

Please sign in to comment.