【发布时间】:2014-11-16 12:06:32
【问题描述】:
我有一个声明为
的图像函数thresholding( const Image &imgSrc, Image &imgDest );
如果我这样做会发生什么;
Image img;
tresholding( img, img );
这是明确定义的吗?因为在这种情况下img 被更改了。
P.S: threshold 读取 imgSrc 如果 `imgSrc[i] imgDest[i] = 255 else imgDest[i] = 0
更准确地说:
__m128i _mm_src = _mm_load_si128 ( any_value );
__m128i _mm_src = _mm_load_si128 ( (__m128i*) &imgSrc[0] );
__m128i _mm_dest = _mm_load_si128 ( (__m128i*) &imgDest[0] );
_mm_dest = mm_cmpgt_epi16 (a, thr);
【问题讨论】:
-
“这个定义明确吗?” 什么应该是未定义的?
-
我想您想在第二个代码块中调用函数
treshold而不是thresholding和Image img()是一个函数声明。 -
@JN11 完全正确,谢谢。
标签: c++ const-correctness