functor 관련 snippet

functor 일반
class fntor$FUNCTOR_NAME$ : public std::unary_function< $ELEMENT_TYPE$, $RETURN_TYPE$ >
{
public:
	explicit fntor$FUNCTOR_NAME$() {};
	
	$RETURN_TYPE$ operator() ( const $ELEMENT_TYPE$& elem ) const
	{
		$end$
	}
	
private:
};
functor this 포인터 포함
class fntor$FUNCTOR_NAME$ : public std::unary_function< $ELEMENT_TYPE$, $RETURN_TYPE$ >
{
public:
	explicit fntor$FUNCTOR_NAME$( $ClassName$* pThis )
		: _pThis( pThis )
	{};
	
	$RETURN_TYPE$ operator() ( const $ELEMENT_TYPE$& elem ) const
	{
		$end$
	}
	
private:
	$ClassName$* _pThis;
};
-------------------------
2011/01/06 12:22 2011/01/06 12:22

글 걸기 주소 : 이 글에는 트랙백을 보낼 수 없습니다

덧글을 달아 주세요