[Random] make_variate_ref proposal

I propose adding a make_variate_ref helper function to Random library to save typing, so I don't have retype the Distribution type twice, and to help with accidentally forgetting to put "&" in the template parameter. Something along the lines of: template<typename Engine, typename Distribution> class boost::variate_generator<Engine &, Distribution &> make_variate_ref(Engine & engine, Distribution & dist) { boost::variate_generator<Engine &, Distribution &> variate(engine, dist); return variate; } What are your thoughts. -Mostafa

AMDG Mostafa wrote:
I propose adding a make_variate_ref helper function to Random library to save typing, so I don't have retype the Distribution type twice, and to help with accidentally forgetting to put "&" in the template parameter. Something along the lines of:
template<typename Engine, typename Distribution> class boost::variate_generator<Engine &, Distribution &> make_variate_ref(Engine & engine, Distribution & dist) { boost::variate_generator<Engine &, Distribution &> variate(engine, dist); return variate; }
What are your thoughts.
Once I get all the distributions updated, variate_generator is going to be deprecated. It's not in the C++0x library. In Christ, Steven Watanabe

On Mon, 02 Aug 2010 19:19:55 -0700, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Mostafa wrote: ... snip ...
Once I get all the distributions updated, variate_generator is going to be deprecated. It's not in the C++0x library.
In Christ, Steven Watanabe
Is there any documentation on what's going to replace it? If so, can you point it out? Additionally, it might be a good idea to make a reference to what you mentioned in the Random documentation. Thanks, Mostafa

AMDG Mostafa wrote:
On Mon, 02 Aug 2010 19:19:55 -0700, Steven Watanabe <watanabesj@gmail.com> wrote:
Once I get all the distributions updated, variate_generator is going to be deprecated. It's not in the C++0x library.
Is there any documentation on what's going to replace it? If so, can you point it out?
The documentation will be updated along with the actual code changes. It will just follow the C++0x interface. You'll be able to pass any Random Number Engine to a Random Distribution directly.
Additionally, it might be a good idea to make a reference to what you mentioned in the Random documentation.
In Christ, Steven Watanabe
participants (2)
-
Mostafa
-
Steven Watanabe