A possible bug

Ivo Doko ivo.doko@gmail.com
Tue Oct 7 11:48:00 GMT 2014


On 2014-10-07 12:48, Jonathan Wakely wrote:
> That's almost certainly an improvement anyway, the compiler can pass
> an int_fast8_t in a register more efficiently than passing by
> reference.
>
> But you haven't actually fixed the root cause of the problem, which is
> that you haven't defined your static variables.

Well, where exactly should I "define" them?

Inside the body of the xorshift_engine class I have:

     static constexpr size_t       word_size    = 
std::numeric_limits<UIntType>::digits;
     static constexpr size_t       state_size   = n;
     static constexpr int_fast8_t  shift_1      = a >= 0 ? a : -a;
     static constexpr int_fast8_t  shift_2      = b >= 0 ? b : -b;
     static constexpr int_fast8_t  shift_3      = c >= 0 ? c : -c;
     static constexpr result_type  multiplier   = m;
     static constexpr result_type  default_seed = 5489u;

I don't use these anywhere but inside the bodies of xorshift_engine 
member functions.

I fail to see where else I am supposed to define these variables for use 
inside the class.



More information about the Gcc-help mailing list