Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#942 closed defect (fixed)

DiscreteUniform::result_type is ambiguous

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.17.1
Component: random Version: 0.17
Keywords: Cc:


DiscreteUniform inherits from both Discrete and std::unary_function<unsigned long, unsigned long> and since Discrete has

typedef unsigned long int result_type;

and unary_function is defined as

template <class Arg, class Result>
  struct unary_function {
    typedef Arg argument_type;
    typedef Result result_type;

which means DiscreteUniform::result_type is inherited multiple times. Solution is to cull the inheritance from unary_function and typdef an argument_type

Change History (3)

comment:1 Changed 4 years ago by Peter

Owner: changed from Jari Häkkinen to Peter
Status: newaccepted
Version: trunk0.17

comment:2 Changed 4 years ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3892:

fixes #942

comment:3 Changed 3 years ago by Peter

In 3923:

fixes #942; getvector now clears the passed vector<T> before populating it with values from the istream regardless of whether T is string or numeric.

Note: See TracTickets for help on using tickets.