当我运行下面的警告标志我得到一个类型转换的警告。
#include <boost/multi_array.hpp>
void function (boost::multi_array<unsigned char, 2> matrix) {
int nrows = matrix.shape()[0];
int ncols = matrix.shape()[1];
}
看到警告信息如下。 这是不是意味着我是隐含地转换成'长unsigned int'进入一个经常'int'?
如果是这样,我认为这就是我想要(需要执行的计算与nrows,ncols之后),所以我将如何使转换的明确的?
image.cpp:93:32: warning: conversion to ‘int’ from ‘boost::const_multi_array_ref<float, 2ul, float*>::size_type {aka long unsigned int}’ may alter its value [-Wconversion]
int nrows = matrix.shape()[0];