Topic: Defect report [N2134]: Signature of generate_canonical not useful


Author: "=?iso-8859-1?q?Daniel_Kr=FCgler?=" <daniel.kruegler@googlemail.com>
Date: Thu, 8 Mar 2007 17:44:06 CST
Raw View
In [rand.synopsis]-26.4.2 we have the declaration

template<class RealType, class UniformRandomNumberGenerator,
  size_t bits>
result_type generate_canonical(UniformRandomNumberGenerator& g);

Besides the "result_type" issue (already recognized by Bo Persson
at Sun, 11 Feb 2007 05:26:47 GMT in this group) it's clear, that
the template parameter order is not reasonably choosen: Obviously
one always needs to specify all three parameters, although usually
only two are required, namely the result type RealType and the
wanted bits, because UniformRandomNumberGenerator can usually
be deduced.

Proposed resolution:

In the header <random> synopsis 26.4.2 as well as in the corresponding
function description in 26.4.7.2 between para 2 and 3 change the
declaration

template<class RealType, class UniformRandomNumberGenerator, size_t
bits>
result_type generate_canonical(UniformRandomNumberGenerator& g);

to

template<class RealType, size_t bits, class
UniformRandomNumberGenerator>
RealType generate_canonical(UniformRandomNumberGenerator& g);

Greetings from Bremen,

Daniel Kr   gler


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]