Boost logo

Boost :

Subject: [boost] [Random] make_variate_ref proposal
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2010-08-02 21:46:42


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


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