This is an automated email from the ASF dual-hosted git repository.
thiru pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 25831a6ea AVRO-4101: [C++] Remove
boost::{blank,function,shared_ptr,static_assert,utility} (#3272)
25831a6ea is described below
commit 25831a6ea57178a7fdc711d867560d7d84827a39
Author: Gang Wu <[email protected]>
AuthorDate: Sun Dec 29 16:43:10 2024 +0800
AVRO-4101: [C++] Remove
boost::{blank,function,shared_ptr,static_assert,utility} (#3272)
---
lang/c++/impl/json/JsonIO.hh | 1 -
lang/c++/include/avro/DataFile.hh | 3 +--
lang/c++/include/avro/Generic.hh | 2 --
lang/c++/include/avro/Specific.hh | 3 ++-
lang/c++/include/avro/Stream.hh | 2 --
lang/c++/include/avro/buffer/detail/BufferDetail.hh | 16 ++++++----------
6 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/lang/c++/impl/json/JsonIO.hh b/lang/c++/impl/json/JsonIO.hh
index 499255c57..9fdc482ed 100644
--- a/lang/c++/impl/json/JsonIO.hh
+++ b/lang/c++/impl/json/JsonIO.hh
@@ -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>
diff --git a/lang/c++/include/avro/DataFile.hh
b/lang/c++/include/avro/DataFile.hh
index 7371d4e08..dcfddf774 100644
--- a/lang/c++/include/avro/DataFile.hh
+++ b/lang/c++/include/avro/DataFile.hh
@@ -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 {
diff --git a/lang/c++/include/avro/Generic.hh b/lang/c++/include/avro/Generic.hh
index ad8a73c7e..2eb344799 100644
--- a/lang/c++/include/avro/Generic.hh
+++ b/lang/c++/include/avro/Generic.hh
@@ -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"
diff --git a/lang/c++/include/avro/Specific.hh
b/lang/c++/include/avro/Specific.hh
index 247d86da7..1c4b183b5 100644
--- a/lang/c++/include/avro/Specific.hh
+++ b/lang/c++/include/avro/Specific.hh
@@ -48,7 +48,8 @@
*/
namespace avro {
-typedef boost::blank null;
+struct null {
+};
template<typename T>
void encode(Encoder &e, const T &t);
diff --git a/lang/c++/include/avro/Stream.hh b/lang/c++/include/avro/Stream.hh
index 783e4513c..de213404d 100644
--- a/lang/c++/include/avro/Stream.hh
+++ b/lang/c++/include/avro/Stream.hh
@@ -24,8 +24,6 @@
#include <memory>
#include <vector>
-#include "boost/utility.hpp"
-
#include "Config.hh"
#include "Exception.hh"
diff --git a/lang/c++/include/avro/buffer/detail/BufferDetail.hh
b/lang/c++/include/avro/buffer/detail/BufferDetail.hh
index 697c8f41c..1b7663afc 100644
--- a/lang/c++/include/avro/buffer/detail/BufferDetail.hh
+++ b/lang/c++/include/avro/buffer/detail/BufferDetail.hh
@@ -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
@@ -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
@@ -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
@@ -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),
@@ -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.