0
私は機能上からresults
を返すようにしたい、このは、デフォルト値
static int locationinfo(const char *pszSrcFilename
, const char *pszLocX
, const char *pszLocY
, const char *Srsofpoints=NULL
, std::vector<PixelData>& results=std::vector<PixelData>
/* char **papszOpenOptions = NULL,int nOverview = -1,*/
)
{
--filling results
return 1;
}
のようなものである機能を持つが必要です。私は&
を使用しますが、コンパイラは、私は関数定義のstd::vector<PixelData>
のデフォルト値を定義する方法、results
のデフォルト値を必要ですか?
は私の誤りである
error: default argument missing for parameter 5 of ‘int locationinfo(const char*, const char*, const char*, const char*, std::vector<PixelData>&)’
static int locationinfo(const char *pszSrcFilename , const char *pszLocX ,const char *pszLocY,const char *Srsofpoints=NULL
^~~~~~~~~~~~
おかげ
nonconst参照は一時ファイルにバインドできません。 'const'リファレンスで渡してみましたか?デフォルトの 'std :: vector'を構築しないことに加えて、' std :: vector() 'となるでしょう。 –
@AlgirdasPreidžiusconstを使うとオブジェクトを修正してベクトルに追加できますか? –
@MajidHojati _ "constを使うとオブジェクトを修正してベクターに追加できますか?" 'srsofpoints'の前に' results'パラメータを移動し、デフォルト値の必要性を取り除くのはどうでしょうか? – user0042