내가 가지고있는 일반적인 기능 : void ImageAlbum::ExpressButtonPressed(
boost::function<
void (
thumb::PhotoPrintThumbnail*,
thumb::PhotoPrintFormat,
thumb::PhotoPrintQuantity
)
나는 형태의 기능을 가지고있다. 조건은 다른 호출 사이트에서 다른 조건을 제공하기 때문에 Functor 인수로 표현되었습니다. 이제는 직접 사용하는 것이 매우 간단하지만 가능하면 피해야 할 작은 쓰레기 수거 기능이나 functor 객체를 많이 선언해야합니다. Boost의 람다 라이브러리에서 이러한 문제를 해결할 수있는 방법을 찾고 있었지만 근본적인 것이 빠
boost :: lambda를 사용하여 문자열의 후속 공백을 제거하고 하나의 공백 만 남깁니다. 나는이 프로그램을 시험해 보았다. #include <algorithm>
#include <iostream>
#include <string>
#include <boost/lambda/lambda.hpp>
int main()
{
std::str