This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.

### 874. Missing `initializer_list` constructor for `discrete_distribution`

Section: 26.6.9.6.1 [rand.dist.samp.discrete] Status: Resolved Submitter: Daniel Krügler Opened: 2008-08-22 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [rand.dist.samp.discrete].

View all issues with Resolved status.

Discussion:

During the Sophia Antipolis meeting it was decided to separate from 793 a subrequest that adds initializer list support to `discrete_distribution`, specifically, the issue proposed to add a c'tor taking a `initializer_list<double>`.

Proposed resolution:

1. In 26.6.9.6.1 [rand.dist.samp.discrete] p. 1, class `discrete_distribution`, just before the member declaration

   >     explicit discrete_distribution(const param_type& parm);

   insert

   >     discrete_distribution(initializer_list<double> wl);

2. Between p.4 and p.5 of the same section insert a new paragraph as part of the new member description:

   >     discrete_distribution(initializer_list<double> wl);

   > > Effects: Same as `discrete_distribution(wl.begin(), wl.end())`.

Rationale:

Addressed by N2836 "Wording Tweaks for Concept-enabled Random Number Generation in C++0X".