[关闭]
@StarSky 2017-07-04T02:52:01.000000Z 字数 1151 阅读 424

2017-06-29 puzzle about "allocator" and chown

工作日记 C++


I solve this question by restart CLion 😄

  1. CommonSegmentor::getPoint(elementInfo[4].center, Yrange, Xrange);

I noticed that there is a red wavy line under the elementInfo[4].center
And the message is

Parameter type mismatch:types vector<Point> and vector<Point, allocator<Point>> are not compatible

I am not sure whether the warming is related to memory allocation, but it refers to the allocator.

I have a try changing the return to void, but it don' work. 🤷
There is the function.

  1. void CommonSegmentor::getPoint(vector<Point> &center,Vec2i Yrange,Vec2i Xrange){
  2. vector<Point>::iterator iter;
  3. for(iter = center.begin();iter != center.end();iter++){
  4. Point pointTemp = {(*iter).x - Xrange[0],(*iter).y - Yrange[0]};
  5. (*iter) = pointTemp;
  6. }
  7. }

elementInfo[4] is a struct named TransformedXYInfo.

  1. struct TransformedXYInfo{
  2. int flag;
  3. Point topPoint;
  4. Point bottomPoint;
  5. float elementWidth;
  6. vector<Point> center;
  7. };

To avoid modifying the config frequently, we were told to create a new folder in the root directory.[hmmm....😄
Then I asked my colleagues how to change the permissions of the document, I get the command:

chown -R saber:staff export

A digression, It's there any frame in C++ jusf like spring in Java?


ref:
http://www.cnblogs.com/peida/archive/2012/12/04/2800684.html

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注