|
From: Slava M. <sm...@li...> - 2010-10-29 21:39:14
|
The following declaration in KnuthUniformRng effectively makes this class non-copyable: std::vector<double>::const_iterator ranf_arr_ptr, _arr_sentinel; However, KnuthUniformRng is not declared as such. As a result, any attempt to call next() of a copy of any temporal instance of KnuthUniformRng ends up in a crash (let me know if further elaboration is needed). I don't believe this is an intended design. There are two possible ways to fix: either to keep indices instead of const_iterator, or to implement a copy constructor and an assignment operator. I personally prefer the former, but can provide any fix community will choose. Best, Slava Mazur |