---
name: "std::xor_combine"
section: "3"
platform: "linux"
package: "libstdc++6-4.3-doc"
version: "4.3.2-1.1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/std::xor_combine"
---

# std::xor\_combine(3)

## NAME

std::xor\_combine -

## SYNOPSIS

## Detailed Description

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> class std::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>

A random number generator adaptor class that combines two random number generator engines into a single output sequence.

Definition at line 1224 of file tr1\_impl/random.

### Public Types

typedef \_\_gnu\_cxx::\_\_conditional\_type\<(sizeof(\_Result\_type1) \> **\_Result\_type1**\
 typedef \_UniformRandomNumberGenerator1 **base1\_type**\
 typedef \_UniformRandomNumberGenerator2 **base2\_type**\
 typedef \_\_gnu\_cxx::\_\_conditional\_type\<(sizeof(\_Result\_type1) \> \_Result\_type2::\_\_type **result\_type**\

### Public Member Functions

const **base1\_type** & **base1** () const \
 const **base2\_type** & **base2** () const \
 result\_type **max** () const \
 result\_type **min** () const \
 result\_type **operator()** ()\
 template\<class \_Gen\> void **seed** (\_Gen &\_\_g)\
 void **seed** ()\
 typedef \_\_gnu\_cxx::\_\_conditional\_type\<(sizeof(\_Result\_type1) \> **sizeof** (\_Result\_type2))\
 template\<class \_Gen\> **xor\_combine** (\_Gen &\_\_g)\
 **xor\_combine** (unsigned long \_\_s)\
 **xor\_combine** (const **base1\_type** &\_\_rng1, const **base2\_type** &\_\_rng2)\

### Static Public Attributes

static const int **shift1**\
 static const int **shift2**\

### Friends

bool **operator!=** (const **xor\_combine** &\_\_lhs, const **xor\_combine** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator11, int \_\_s11, class \_UniformRandomNumberGenerator21, int \_\_s21, typename \_CharT, typename \_Traits\> **std::basic\_ostream**\< \_CharT, \_Traits \> & **operator\<\<** (**std::basic\_ostream**\< \_CharT, \_Traits \> &\_\_os, const **xor\_combine**\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> &\_\_x)\
 bool **operator==** (const **xor\_combine** &\_\_lhs, const **xor\_combine** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator11, int \_\_s11, class \_UniformRandomNumberGenerator21, int \_\_s21, typename \_CharT, typename \_Traits\> **std::basic\_istream**\< \_CharT, \_Traits \> & **operator\>\>** (**std::basic\_istream**\< \_CharT, \_Traits \> &\_\_is, **xor\_combine**\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> &\_\_x)\

## Member Typedef Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_UniformRandomNumberGenerator1 std::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::base1\_type

The type of the first underlying generator engine.

Definition at line 1233 of file tr1\_impl/random.

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_UniformRandomNumberGenerator2 std::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::base2\_type

The type of the second underlying generator engine.

Definition at line 1235 of file tr1\_impl/random.

## Member Function Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> result\_type std::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::operator() ()` [inline]`

Gets the next random number in the sequence.

Definition at line 1305 of file tr1\_impl/random.

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_\_gnu\_cxx::\_\_conditional\_type\<(sizeof(\_Result\_type1) \> std::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::sizeof (\_Result\_type2)

The type of the generated random value.

## Friends And Related Function Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> bool operator!= (const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_lhs, const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_rhs)` [friend]`

Compares two xor\_combine random number generator objects of the same type for inequality.

**Parameters:**

*\_\_lhs* A xor\_combine random number generator object. \
 *\_\_rhs* Another xor\_combine random number generator object.

**Returns:**

true if the two objects are not equal, false otherwise.

Definition at line 1339 of file tr1\_impl/random.

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> template\<class \_UniformRandomNumberGenerator11, int \_\_s11, class \_UniformRandomNumberGenerator21, int \_\_s21, typename \_CharT, typename \_Traits\> std::basic\_ostream\<\_CharT, \_Traits\>& operator\<\< (std::basic\_ostream\< \_CharT, \_Traits \> & \_\_os, const xor\_combine\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> & \_\_x)` [friend]`

Inserts the current state of a xor\_combine random number generator engine `__x` into the output stream `__os`.

**Parameters:**

*\_\_os* An output stream. \
 *\_\_x* A xor\_combine random number generator engine.

**Returns:**

The output stream with the state of `__x` inserted or in an error state.

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> bool operator== (const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_lhs, const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_rhs)` [friend]`

Compares two xor\_combine random number generator objects of the same type for equality.

**Parameters:**

*\_\_lhs* A xor\_combine random number generator object. \
 *\_\_rhs* Another xor\_combine random number generator object.

**Returns:**

true if the two objects are equal, false otherwise.

Definition at line 1322 of file tr1\_impl/random.

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> template\<class \_UniformRandomNumberGenerator11, int \_\_s11, class \_UniformRandomNumberGenerator21, int \_\_s21, typename \_CharT, typename \_Traits\> std::basic\_istream\<\_CharT, \_Traits\>& operator\>\> (std::basic\_istream\< \_CharT, \_Traits \> & \_\_is, xor\_combine\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> & \_\_x)` [friend]`

Extracts the current state of a xor\_combine random number generator engine `__x` from the input stream `__is`.

**Parameters:**

*\_\_is* An input stream. \
 *\_\_x* A xor\_combine random number generator engine.

**Returns:**

The input stream with the state of `__x` extracted or in an error state.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
