ホーム » VC » C2440: ‘return’ : cannot convert …

2023年12月
 12
3456789
10111213141516
17181920212223
24252627282930
31  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,457 アクセス



C2440: ‘return’ : cannot convert …

以前,iniレジストリ を操作する関数を作成した.
それで,少しずつ書き換えていると…

--------------------Configuration: PrtctT - Win32 Debug--------------------
Compiling...
PrtctT.cpp
t:\develop\_.src\__win\ri_reg.hxx(383) : error C2440: 'return' : cannot convert from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'int'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
        l:\document\develop\tools\_yet\_other\key2013\prtctt\prtctt.cpp(162) : see reference to function template instantiation 'int __cdecl REG_get(struct HKEY__ *,const class std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const int &)' being compiled
Error executing cl.exe.

PrtctT_d.exe - 1 error(s), 0 warning(s)

通常の関数であればうまく機能すると思うが…
関数 template は難しい.
error C2440: 'return' : '...' から 'int' に変換することはできません。
コメントにしている部分で書き換えれば OK .

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.
%d人のブロガーが「いいね」をつけました。