C++ Library - <utility>


It contains utilities in unrelated domains.

  • Pairs − these objects can hold two values of different types: pair, make_pair, piecewise_construct, piecewise_construct_t.

  • Generic relational operators − It is a standard definitions for the relational operators !=, >, <= and >= under a specific namespace: rel_ops.

  • Rvalue casts (C++11) − It allows the generation of rvalue references: forward, move, move_if_noexcept, declval.

  • Generic swap function − This a standard definition used by default by the components of the standard library for all types that do not provide their own overload: swap.


Sr.No. Function & description
1 swap

It exchanges values of two objects.

2 make_pair

It constructs the pair objects.

3 forward

It is a forward argument.

4 move

It moves as rvalue.

5 move_if_noexcept

It moves if noexcept.

6 declval

It is a declaration value.


Sr.No. Constant & description
1 piecewise_construct

It is a piecewise construct constant.


Sr.No. Namespace & description
1 rel_ops

It is a relational Operators.