일부 기능 프로그래밍을 C++로 가져올 수있는 방법이 있습니까? 일부 LAMBDA 함수 또는 연산자를 다른 함수의 매개 변수로 전달하고자합니다. 모두일부 함수 나 연산자를 매개 변수로 전달하는 방법이 있습니까?
void test2(DWORD foo)
{
someconnection.Open();
__asm { call foo; } // very weird way, don't think that could work
someconnection.Close();
}
및 사용 :
void test(DWORD foo)
{
try { __asm { call foo; } } // very weird way, don't think that could work
catch (...) {() }
}
나 : 예를 들어
int main()
{
...
dosomething();
...
void operator()(int n) // lambda expression, not sure if that correct way creating them
{
dosomething();
dosomethingelse();
}
test (*operator(5)) // here is what I want
test2 (*operator(10)) // here is what I want
...
dosomethingelse();
...
}
나는 비주얼 스튜디오 2010와 나는 C의 +를 사용할 수 있는지 확실하지를 사용하고 있습니다 거기에 + 0x하지만 내가하고 싶은 일을 할 수 있다면 부스트를 사용할 수 있습니다.
그래서 몇 가지 방법이 있습니까?
Google 함수 포인터 및 부스트 :: 함수 – Patrick