2016-11-23 6 views
0

埋め込みPosixでbind関数をコンパイルする必要があります。boost::bindまたはstd::bindを使用することはできません。関数を分割する方法:bind

だから私は、機能分割したい: threadReducer.reduce(boost::bind(&DepthMap::observeDepthRow, this, _1, _2, _3), 3, height-3, 10);

機能observeDepthRow:
void DepthMap::observeDepthRow(int yMin, int yMax, RunningStats* stats)
と機能削減:Plzは、私は機能を分割する手助け
void IndexThread::reduce(boost::function<void(int,int,RunningStats*)> callPerIndex, int first, int end, int stepSize = 0)

を、私はC++でうまくいきません

+2

なぜboost :: bind'(または 'std :: bind')を使用できないのですか?特にあなたが(明らかに) 'boost :: function'を引き続き使用できるのであれば? –

+0

これは私の前のコードです、私はすべて変更が必要です。関数reduceは、 "follow symbol"をクリックし、関数を表示します。 – nistar

+0

私のposix embeddedはライブラリ 'boost'を使用できません。 – nistar

答えて

0

ブーストまたはC++ 11を使用できない場合、その場合はyo uがこのようにしてみてください可能性があります

void IndexThread::reduce(void(*function)(int,int,RunningStats*), int first, int end, int stepSize = 0) 

とあなたのobserveDepthRow static

static void DepthMap::observeDepthRow(int yMin, int yMax, RunningStats* stats) 

は、その後、あなたがこのようにそれを呼び出すことができます。この場合には、あなたの方法を確認する必要がありますが

threadReducer.reduce(observeDepthRow, 3, height-3, 10); 

staticあなたがそうでない場合はthisを見てください。

関連する問題