tôi đọc nó từ mã nguồn của opencvtại sao phải viết mã C như "while ((void) 0, 0)"
#define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \
do \
{ \
if (ippiFilterMedianBorderGetBufferSize(dstRoiSize, maskSize, \
ippDataType, CV_MAT_CN(type), &bufSize) >= 0) \
{ \
Ipp8u * buffer = ippsMalloc_8u(bufSize); \
IppStatus status = ippiFilterMedianBorder_##flavor(src.ptr<ippType>(), (int)src.step, \
dst.ptr<ippType>(), (int)dst.step, dstRoiSize, maskSize, \
ippBorderRepl, (ippType)0, buffer); \
ippsFree(buffer); \
if (status >= 0) \
{ \
CV_IMPL_ADD(CV_IMPL_IPP); \
return; \
} \
} \
setIppErrorStatus(); \
} \
while ((void)0, 0)
Tôi có thể hiểu được khi (0) ở đây, nhưng tại sao để thêm " (void) 0 ".
Để bao gồm nghệ thuật ASCII ') 0, 0)'? – ikegami
http://stackoverflow.com/questions/4178695/c-what-is-the-purpose-of-casting-to-void – blfuentes
bản sao có thể có của [do {...} trong khi (0) - điều gì là tốt cho?] (http://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for) –