[C++] 델리게이트
Delegate 개념
델리게이트란 대리자라는 의미로 함수를 변수처럼 사용할 수 있는것 입니다. 
주로 콜백함수 처럼 무언가의 처리가 끝난 후 호출하고 싶은 처리, 비동기 처리의 종료통지 등에 사용됩니다. 
단, C++에서 Delegate 기본 언어 기능이 아니기 때문에 라이브러리, 함수 포인터나 함수 개체를 사용하여 자체적으로 Delegate 구현할 수 있습니다.
유니티에서 델리게이트 ->유니티 
C#에서 델리게이트 ->C# 
코드 및 주석
#include <iostream>
// Define the function signature for the delegate
typedef void (*MyDelegate)(int);
// Define a function that will be called by the delegate
void foo(int x) {
    std::cout << "foo(" << x << ")" << std::endl;
}
int main() {
    // Declare a variable to hold the delegate function pointer
    MyDelegate delegate = nullptr;
    // Set the delegate to point to the foo function
    delegate = &foo;
    // Call the delegate, which will call the foo function
    delegate(123);
    return 0;
}