示例#1
0
void test_eq()
{
    const size_t N = 10;
    int* a = new int[N];
    for (int i = 0; i < N; ++i)
        a[i] = 10; // all the same
    test_eq0(a, a+N, std::less<int>());
    test_eq0(a, a+N, std::greater<int>());
    delete [] a;
}
static int test_eq()
{
    const int N = 10;
    int* a = new int[N];
    for (int i = 0; i < N; ++i)
        a[i] = 10; // all the same
    TC_ASSERT_FUNC((test_eq0(a, a+N, std::less<int>())));
    TC_ASSERT_FUNC((test_eq0(a, a+N, std::greater<int>())));
    delete [] a;
    return 0;
}