binary_delegate_noreturn (STL/CLR)
Genereic 클래스를 반환 하는 두 인수 대리자를 설명 void.사용 하 여 대리자의 인수를 지정 합니다.
generic<typename Arg1,
typename Arg2>
delegate void binary_delegate(Arg1, Arg2);
매개 변수
Arg1
첫 번째 인수의 유형을 지정 합니다.Arg2
두 번째 인수의 유형을 지정 합니다.
설명
Genereic 대리자 반환 하는 함수를 두 인수에 설명 합니다. void.
에 대 한 note:
binary_delegate_noreturn<int, int> Fun1;
binary_delegate_noreturn<int, int> Fun2;
형식 Fun1 및 Fun2 는 동의어, 반면에 대 한:
delegate void Fun1(int, int);
delegate void Fun2(int, int);
동일한 형식이 아닙니다.
예제
// 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);
}
요구 사항
헤더: < cliext/기능 >
네임 스페이스: cliext