Boost logo

Boost :

From: Joel Young (jdy_at_[hidden])
Date: 2004-05-13 10:26:57


I tried to use boost::random::uniform_int with the
in-development big_integer library.

Here is a test code:

#include <boost/random/uniform_int.hpp>
#include "boost/big_integer.hpp"

///////////////////////
int main(int argc, char* argv[]) {
  typedef boost::big_integer data_t;
// typedef long long data_t;

  data_t n(235345345);

  boost::uniform_int<data_t> rng(0,n-1);

  return 0;
}
///////////////////////

==> g++ --version
g++ (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

Compiling this yields:

///////////////////////
g++ -o a -I ~/boost/boost/include/boost-1_31/ randomtest.cpp
/home/afit1/fac/jyoung/boost/boost/include/boost-1_31/boost/random/uniform_int.hpp:
In
   constructor `boost::uniform_int<IntType>::uniform_int(IntType,IntType)
   [with IntType = main(int, char**)::data_t]':
randomtest.cpp:10: instantiated from here
/home/afit1/fac/jyoung/boost/boost/include/boost-1_31/boost/random/uniform_int.hpp:52:
error: invalid
   application of `sizeof' to an incomplete type
//////////////////////

Joel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk