forked from boostorg/unordered
Improved support for Visual C++.
[SVN r2985]
This commit is contained in:
1 parent
58dda15273
commit
ff91c72eec
19 files changed
+154
-81
No files matched your search
@@ -11,18 +11,24 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#if 0
|
||||
#include <boost/random/inversive_congruential.hpp>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
#include <boost/random/lagged_fibonacci.hpp>
|
||||
#include <boost/random/uniform_real.hpp>
|
||||
#include <boost/random/variate_generator.hpp>
|
||||
#else
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
#include "./fwd.hpp"
|
||||
|
||||
namespace test
|
||||
{
|
||||
#if 0
|
||||
typedef boost::hellekalek1995 integer_generator_type;
|
||||
typedef boost::lagged_fibonacci607 real_generator_type;
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct generator
|
||||
@@ -36,20 +42,30 @@ namespace test
|
||||
|
||||
inline int generate(int const*)
|
||||
{
|
||||
#if 0
|
||||
integer_generator_type gen;
|
||||
boost::uniform_int<> dist(0, 1000);
|
||||
static boost::variate_generator<integer_generator_type, boost::uniform_int<> >
|
||||
vg(gen, dist);
|
||||
return vg();
|
||||
#else
|
||||
using namespace std;
|
||||
return rand();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline char generate(char const*)
|
||||
{
|
||||
#if 0
|
||||
integer_generator_type gen;
|
||||
boost::uniform_int<char> dist(32, 128);
|
||||
boost::uniform_int<char> dist(32, 127);
|
||||
static boost::variate_generator<integer_generator_type, boost::uniform_int<char> >
|
||||
vg(gen, dist);
|
||||
return vg();
|
||||
#else
|
||||
using namespace std;
|
||||
return rand() % (128 - 32) + 32;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline std::string generate(std::string const*)
|
||||
@@ -74,11 +90,16 @@ namespace test
|
||||
|
||||
float generate(float const*)
|
||||
{
|
||||
#if 0
|
||||
real_generator_type gen;
|
||||
boost::uniform_real<float> dist;
|
||||
static boost::variate_generator<real_generator_type, boost::uniform_real<float> >
|
||||
vg(gen, dist);
|
||||
return vg();
|
||||
#else
|
||||
using namespace std;
|
||||
return (double) rand() / (double) RAND_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class T1, class T2> std::pair<T1, T2> generate(
|
||||
|
||||
Reference in new issue
Block a user