Ich lese es aus dem Quellcode von opencvwarum C-Code wie "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)
Ich kann verstehen, während (0) in hier, aber warum hinzufügen "schreiben (ungültig) 0 ".
Um ASCII Art ') 0, 0)'? – ikegami
http://StackOverflow.com/Questions/4178695/c-what-is-the-purpose-of-casting-to-void – blfuentes
mögliche Duplikate von [do {...} while (0) - was ist gut für?] (http://stackoverflow.com/questions/257418/do-while-0-what-isit-good-for) –