Namespace
Varianti

std::swap

Da cppreference.com.
< cpp‎ | algorithm

 
 
Algoritmo libreria
Funzioni
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 modifica le operazioni di sequenza
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.
Modifica delle operazioni di sequenza
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.
Partizionamento operazioni
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.
Ordinamento delle operazioni (su intervalli ordinati)
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.
Binarie (le operazioni di ricerca sui campi ordinati)
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.
Impostare le operazioni (su intervalli ordinati)
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.
Heap operazioni
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.
Minimo / massimo le operazioni
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.
Operazioni numeriche
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.
Libreria 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.
 
Defined in header <algorithm>
Defined in header <utility>
(C fino + 11)
(dal 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) (dal C++11)
Scambi i valori indicati.
Original:
Exchanges the given values.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Scambia i valori a e b.
Original:
Swaps the values a and b.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Swap gli array a e b. In effetti le chiamate std::swap_ranges(a, a+N, b).
Original:
Swaps the arrays a and b. In effect calls std::swap_ranges(a, a+N, b).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica] Parametri

a, b -
i valori da scambiare
Original:
the values to be swapped
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type requirements
-
T must meet the requirements of MoveAssignable and MoveConstructible.
-
T2 must meet the requirements of Swappable.

[modifica] Valore di ritorno

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

[modifica] Eccezioni

1)
noexcept specification:  (dal C++11)
noexcept(noexcept(

    std::is_nothrow_move_constructible<T>::value &&
    std::is_nothrow_move_assignable<T>::value

))
2)
noexcept specification:  (dal C++11)
noexcept(noexcept(swap(*a, *b)))

[modifica] Complessità

1)
Constant
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)
Lineare in 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.

[modifica] Specializzazioni

Entrambi i corsi sono personalizzati e sovraccarichi dell'algoritmo std::swap sono permessi, ma i sovraccarichi sono in genere preferito dal specializzazioni di un modello di funzione non sono ammessi per le classi template. Le funzioni di libreria utilizzare sempre fornito dall'utente sovraccarichi durante lo scambio, se si trovano per argomento-dipendente di ricerca (come da concetto Swappable).
Original:
Both custom specializations and overloads of the std::swap algorithm are allowed, but the overloads are generally preferred since specializations of a function template aren't allowed for template classes. Library functions always use the user-provided overloads when swapping, if they are found by argument-dependent lookup (as per Swappable concept).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gli overload che seguono sono già fornite dalla libreria standard:
Original:
The following overloads are already provided by the standard library:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello) [edit]
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)
specializzata l'algoritmo 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.

(funzione di modello)

[modifica] Esempio

[modifica] Vedi anche

swap gli elementi a cui punta due iteratori
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.

(funzione di modello) [edit]
Scambia due gamme di elementi
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.

(funzione di modello) [edit]