Skip to content

Commit 7b12f4d

Browse files
Remove dependency on Boost.random.
Boost.iostreams now requires C++11, so normally a <random> implementation shall exists in the compiling toolchain, so use this instead of the Boost implementation. This allows to no longer depend explicitly on libboost_random.so, which is now the case with the recent modular works (see other case of these extra dependencies being added with modular changes in boostorg/regex#253 or boostorg/system#132)
1 parent 8561bdb commit 7b12f4d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

build.jam

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ constant boost_dependencies :
1818
/boost/mpl//boost_mpl
1919
/boost/numeric_conversion//boost_numeric_conversion
2020
/boost/preprocessor//boost_preprocessor
21-
/boost/random//boost_random
2221
/boost/range//boost_range
2322
/boost/regex//boost_regex
2423
/boost/smart_ptr//boost_smart_ptr

include/boost/iostreams/filter/test.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@
2424
#include <iterator>
2525
#include <string>
2626
#include <vector>
27-
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) && \
28-
!BOOST_WORKAROUND(__MWERKS__, <= 0x3003) \
29-
/**/
30-
# include <boost/random/linear_congruential.hpp>
31-
# include <boost/random/uniform_smallint.hpp>
32-
#endif
27+
#include <random>
3328
#include <boost/iostreams/categories.hpp>
3429
#include <boost/iostreams/compose.hpp>
3530
#include <boost/iostreams/copy.hpp>
@@ -69,8 +64,8 @@ const std::streamsize default_increment = 5;
6964
/**/
7065
std::streamsize rand(std::streamsize inc)
7166
{
72-
static rand48 random_gen;
73-
static uniform_smallint<int> random_dist(0, static_cast<int>(inc));
67+
static std::mt19937 random_gen;
68+
static std::uniform_int_distribution<int> random_dist(0, static_cast<int>(inc));
7469
return random_dist(random_gen);
7570
}
7671
#else

0 commit comments

Comments
 (0)