Query/disconnect a signal-slot connection.

The `signals2::connection` class represents a connection between a Signal and a Slot. It is a lightweight object that has the ability to query whether the signal and slot are currently connected, and to disconnect the signal and slot. It is always safe to query or disconnect a connection.

# Thread Safety

The methods of the `connection` class are thread-safe with the exception of `swap` and the assignment operator. A `connection` object should not be accessed concurrently when either of these operations is in progress. However, it is always safe to access a different `connection` object in another thread, even if the two `connection` objects are copies of each other which refer to the same underlying connection.

Sets the currently represented connection to the NULL connection.

`!this->`connected`()`.

Will not throw.

const `connection`&

`this` references the connection referenced by `other`.

Will not throw.

signals2::connection

connection
&&

Move constructor.

`this` references the connection formerly referenced by `other`. The moved-from `other` no longer references any connection.

Will not throw.

const `connection`&

`this` references the connection referenced by `rhs`.

Will not throw.

signals2::connection

connection
&&

Move assignment.

`this` references the connection formerly referenced by `rhs`. The moved-from `rhs` no longer references any connection.

Will not throw.

void

If `this->`connected`()`, disconnects the signal and slot referenced by this; otherwise, this operation is a no-op.

`!this->`connected`()`.

bool

`true` if this references a non-NULL connection that is still active (connected), and `false` otherwise.

Will not throw.

bool

Queries if the connection is blocked. A connection may be blocked by creating a `boost::signals2::shared_connection_block` object.

`true` if the associated slot is either disconnected or blocked, `false` otherwise.

Will not throw.

void ``connection`&`

Swaps the connections referenced in `this` and `other`.

Will not throw.

bool `const `connection`&`

`true` if `this` and `other` reference the same connection or both reference the NULL connection, and `false` otherwise.

Will not throw.

bool `const `connection`&`

`!(*this == other)`

Will not throw.

bool `const `connection`&`

`true` if the connection referenced by `this` precedes the connection referenced by `other` based on some unspecified ordering, and `false` otherwise.

Will not throw.

void ``connection`&` ``connection`&`

`x.swap(y)`

Will not throw.

`connection`
Limits a signal-slot connection lifetime to a particular scope.

``connected`() == false`

Default constructs an empty scoped_connection.

Will not throw.

const `connection`&

`this` references the connection referenced by `other`.

``connected`() == other.connected()`

Will not throw.

signals2::scoped_connection

scoped_connection
&&

Move constructor.

`this` references the connection formerly referenced by `other`. The moved-from `other` no longer references any connection.

Will not throw.

signals2::connection

connection
&&

Move constructor.

`this` references the connection formerly referenced by `other`. The moved-from `other` no longer references any connection.

Will not throw.

const `connection`&

Copy assignment from unscoped connection.

`this` references the connection referenced by `rhs`. If `this` already references another connection, the old connection will be disconnected first.

``connected`() == other.connected()`

Will not throw.

signals2::scoped_connection

scoped_connection
&&

Move assignment.

`this` references the connection formerly referenced by `rhs`. The moved-from `rhs` no longer references any connection. If `this` already references another connection, the old connection will be disconnected first.

Will not throw.

signals2::connection

connection
&&

Move assignment.

`this` references the connection formerly referenced by `rhs`. The moved-from `rhs` no longer references any connection. If `this` already references another connection, the old connection will be disconnected first.

Will not throw.

If `this->`connected`()`, disconnects the signal-slot connection.

`connection`

Releases the connection so it will not be disconnected by the `scoped_connection` when it is destroyed or reassigned. The `scoped_connection` is reset to the NULL connection after this call completes.

``connected`() == false`

A `connection` object referencing the connection which was released by the `scoped_connection`.

const `scoped_connection`&

The scoped_connection class is not copyable. It may only be copy constructed from an unscoped `connection` object.

const `scoped_connection`&

The scoped_connection class is not copyable. It may only be copy assigned from an unscoped `connection` object.

A `connection` which automatically disconnects on destruction.

# Thread Safety

The methods of the `scoped_connection` class (including those inherited from its base `connection` class) are thread-safe with the exception of `signals2::connection::swap`, `release`, and the assignment operator. A `scoped_connection` object should not be accessed concurrently when any of these operations is in progress. However, it is always safe to access a different `connection` object in another thread, even if it references the same underlying signal-slot connection.