这是函数声明吗

is this a function declaration?

本文关键字:声明 函数      更新时间:2023-10-16

当我从OpenCV或OpenCascade 中读取一些代码时,我经常在C++中看到这种类型的声明+实现

TEST(Shape_SCD, regression)
{
    const int NSN_val=5;//10;//20; //number of shapes per class
    const int NP_val=120; //number of points simplifying the contour
    const float CURRENT_MAX_ACCUR_val=95; //99% and 100% reached in several tests, 95 is fixed as minimum boundary
    ShapeBaseTest<float, computeShapeDistance_Chi> test(NSN_val, NP_val, CURRENT_MAX_ACCUR_val);
    test.safe_run();
}

这可能是一个愚蠢的问题,不是吗?因为我不知道这是什么类型的声明。它看起来确实像一个函数,但没有返回类型。若它是一个构造函数,为什么参数列表中并没有任何类型的变量?

感谢

TEST是一个宏。展开宏后,这将是一个正常的函数定义(带有返回类型)。如果您查找宏的定义,您应该能够看到这一点。