Template Struct random_intersperse_view

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public ranges::view_adaptor< random_intersperse_view< Range, Fn, typename ranges::detail::default_random_engine >, Range, ranges::unknown >

Struct Documentation

template<class Range, class Fn, class URNG = typename ranges::detail::default_random_engine>
struct random_intersperse_view : public ranges::view_adaptor<random_intersperse_view<Range, Fn, typename ranges::detail::default_random_engine>, Range, ranges::unknown>

Implementation of the random_intersperse view as a view adaptor.

Template Parameters:
  • Range – A forward range.

  • Fn – A callable type which takes no arguments and returns values to be inserted.

  • URNG – A random number generator that satisfies the UniformRandomBitGenerator requirements.

Public Functions

random_intersperse_view() = default

Default constructor.

inline constexpr random_intersperse_view(Range range, Fn fn, double probability, URNG &engine = ranges::detail::get_random_engine())

Construct the view from a range to be adapted.

Parameters:
  • range – The range to be adapted.

  • fn – The generator function that returns values to be inserted.

  • probability – The probability of inserting a value on each iteration.

  • engine – The random number generator object.