[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/algorithm/swap [Back]  [Original]

std::swap cppreference.com
cppreference.com
Espaces de noms
Variantes

std::swap

De cppreference.com
 
 
Bibliothque d'algorithmes
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Non-modification de la squence des oprations
Original:
Non-modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modification de la squence des oprations
Original:
Modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Des oprations de partitionnement
Original:
Partitioning operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Oprations de tri (sur les gammes tris)
Original:
Sorting operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_sorted (C++11)
is_sorted_until (C++11)
sort
Oprations binaires de recherche (sur les gammes tris)
Original:
Binary search operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dfinir les oprations (sur les gammes tris)
Original:
Set operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Oprations Heap
Original:
Heap operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Minimum / maximum de fonctionnement
Original:
Minimum/maximum operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Oprations numriques
Original:
Numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bibliothque C
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
<tbody> </tbody>
Dclar dans l'en-tte <algorithm>
Dclar dans l'en-tte <utility>
(avant C++11)
(depuis C++11)
template< class T > void swap( T& a, T& b );
(1)
template< class T2, size_t N > void swap( T2 (&a)[N], T2 (&b)[N]);
(2) (depuis C++11)

change les valeurs donnes.

1) changes les valeurs a et b.

2) Echange les tableaux a et b. Pour cela, appelle std::swap_ranges(a, a+N, b).

Paramtres

a, b - les valeurs permuter
Type requirements
-
T must meet the requirements of MoveAssignable and MoveConstructible.
-
T2 must meet the requirements of Swappable.

Retourne la valeur

Aucune

Exceptions

1)

noexcept specification:   (depuis C++11)
<tbody> </tbody>
noexcept(noexcept( std::is_nothrow_move_constructible<T>::value && std::is_nothrow_move_assignable<T>::value ))

2)

noexcept specification:   (depuis C++11)
<tbody> </tbody>
noexcept(noexcept(swap(*a, *b)))

Complexit

1)

Constante
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

2)

Linaire en N
Original:
Linear in N
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Spcialisations

Il est autoris la fois de surcharger et de spcialiser l'algorithme std::swap, mais les surcharges sont gnralement prfres car les spcialisations d'un modle de fonction ne sont pas autorises pour les classes template. Les fonctions de la bibliothque standard utilisent toujours les surcharges fournies par l'utilisateur lors du swap, si elles sont reconnues lors de la recherche des argument (d'aprs le concept Swappable).

Les surcharges suivantes sont dj fournies par la bibliothque standard :

l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
permet de spcialiser l'algorithme std::swap
(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
l'algorithme spcialis std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)
spcialise l'algorithme std::swap()
(fonction gnrique)

Exemple

Voir aussi

permute les lments points par deux itrateurs
Original:
swaps the elements pointed to by two iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
swaps de deux gammes d'lments
Original:
swaps two ranges of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]

Web Proxy Viewer  |  New URL  |  Original Page