Opened 2 months ago

Closed 2 months 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:

Description

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 (2)

comment:1 Changed 2 months ago by Peter

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

comment:2 Changed 2 months ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3892:

fixes #942

Note: See TracTickets for help on using tickets.