Skip to content

Commit

Permalink
AVRO-4106: [C++] Remove boost::random (#3283)
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtmac authored Jan 7, 2025
1 parent d26a327 commit dd01f97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
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

0 comments on commit dd01f97

Please sign in to comment.