less (STL/CLR)

템플릿 클래스는 functor 설명 첫 번째 인수가 작은 경우에 호출 되 면 true를 반환 하 두 번째 보다.사용 하 여 해당 인수 형식에는 function 개체를 지정 합니다.

template<typename Arg>
    ref class less
    { // wrap operator()
public:
    typedef Arg first_argument_type;
    typedef Arg second_argument_type;
    typedef bool result_type;
    typedef Microsoft::VisualC::StlClr::BinaryDelegate<
        first_argument_type, second_argument_type, result_type>
        delegate_type;

    less();
    less(less<Arg>% right);

    result_type operator()(first_argument_type left,
        second_argument_type right);
    operator delegate_type^();
    };

매개 변수

  • Arg
    인수의 형식입니다.

멤버 함수

형식 정의

설명

delegate_type

제네릭 대리자의 형식입니다.

first_argument_type

Functor 첫 번째 인수의 유형을 지정 합니다.

result_type

Functor 결과 유형을 지정 합니다.

second_argument_type

두 번째 인수 functor 유형을 지정 합니다.

멤버

설명

더 적게

Functor를 생성합니다.

Operator

설명

operator)

원하는 함수를 계산합니다.

연산자 delegate_type ^

대리자에는 functor를 비춥니다.

설명

두 인수 functor 템플릿 클래스를 설명합니다.멤버 연산자를 정의 합니다. operator() 함수로 해당 개체를 호출 하면 되도록만 첫 번째 인수가 작을 경우 true를 반환 둘째 보다.

개체 형식이 함수 인수로 전달할 수도 있습니다 delegate_type^ 및 적절 하 게 변환 됩니다.

예제

// cliext_less.cpp 
// compile with: /clr 
#include <cliext/algorithm> 
#include <cliext/functional> 
#include <cliext/vector> 
 
typedef cliext::vector<int> Myvector; 
int main() 
    { 
    Myvector c1; 
    c1.push_back(4); 
    c1.push_back(3); 
    Myvector c2; 
    c2.push_back(4); 
    c2.push_back(4); 
    Myvector c3(2, 0); 
 
// display initial contents " 4 3" and " 4 4" 
    for each (int elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    for each (int elem in c2) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// transform and display 
    cliext::transform(c1.begin(), c1.begin() + 2, 
        c2.begin(), c3.begin(), cliext::less<int>()); 
    for each (int elem in c3) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/기능 >

네임 스페이스: cliext

참고 항목

참조

greater_equal (STL/CLR)