Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-4106: [C++] Remove boost::random #3283

Merged
merged 1 commit into from
Jan 7, 2025
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
4 changes: 2 additions & 2 deletions lang/c++/impl/DataFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include "Compiler.hh"
#include "Exception.hh"

#include <random>
#include <sstream>

#include <boost/crc.hpp> // for boost::crc_32_type
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include <boost/random/mersenne_twister.hpp>

#ifdef SNAPPY_CODEC_AVAILABLE
#include <snappy.h>
Expand Down Expand Up @@ -236,7 +236,7 @@ void DataFileWriterBase::flush() {
}

DataFileSync DataFileWriterBase::makeSync() {
boost::mt19937 random(static_cast<uint32_t>(time(nullptr)));
std::mt19937 random(static_cast<uint32_t>(time(nullptr)));
DataFileSync sync;
std::generate(sync.begin(), sync.end(), random);
return sync;
Expand Down
7 changes: 3 additions & 4 deletions lang/c++/impl/avrogencpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@
#include <iostream>
#include <map>
#include <optional>
#include <random>
#include <set>
#include <utility>

#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>

#include <boost/random/mersenne_twister.hpp>
#include <utility>

#include "Compiler.hh"
#include "NodeImpl.hh"
#include "ValidSchema.hh"
Expand Down Expand Up @@ -89,7 +88,7 @@ class CodeGen {
const std::string includePrefix_;
const bool noUnion_;
const std::string guardString_;
boost::mt19937 random_;
std::mt19937 random_;

vector<PendingSetterGetter> pendingGettersAndSetters;
vector<PendingConstructor> pendingConstructors;
Expand Down
2 changes: 0 additions & 2 deletions lang/c++/include/avro/Specific.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <string>
#include <vector>

#include "boost/blank.hpp"

#include "AvroTraits.hh"
#include "Config.hh"
#include "Decoder.hh"
Expand Down
Loading