Udostępnij za pośrednictwem


binary_delegate_noreturn (STL/CLR)

Klasa genereic opisuje delegowanego dwóch argumentów, które zwraca void.Umożliwia ona określić delegata pod względem swego argumentu.

generic<typename Arg1,
    typename Arg2>
    delegate void binary_delegate(Arg1, Arg2);

Parametry

  • Argument1
    Typ pierwszego argumentu.

  • Argument2
    Typ drugiego argumentu.

Uwagi

Pełnomocnik genereic opisuje dwóch argumentów funkcji, która zwraca void.

Należy zauważyć, że dla:

binary_delegate_noreturn<int, int> Fun1;

binary_delegate_noreturn<int, int> Fun2;

typy Fun1 i Fun2 są synonimami, podczas gdy od:

delegate void Fun1(int, int);

delegate void Fun2(int, int);

nie są tego samego typu.

Przykład

// cliext_binary_delegate_noreturn.cpp 
// compile with: /clr 
#include <cliext/functional> 
 
void key_compare(wchar_t left, wchar_t right) 
    { 
    System::Console::WriteLine("compare({0}, {1}) = {2}", 
        left, right, left < right); 
    } 
 
typedef cliext::binary_delegate_noreturn<wchar_t, wchar_t> Mydelegate; 
int main() 
    { 
    Mydelegate^ kcomp = gcnew Mydelegate(&key_compare); 
 
    kcomp(L'a', L'a'); 
    kcomp(L'a', L'b'); 
    kcomp(L'b', L'a'); 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

Wymagania

Nagłówek:<cliext/funkcjonalności>

Przestrzeń nazw: cliext

Zobacz też

Informacje

binary_delegate (STL/CLR)

unary_delegate (STL/CLR)

unary_delegate_noreturn (STL/CLR)