Groups | Blog | Home
all groups > visual c libraries > march 2004 >

visual c libraries : C2621 when using "find_first_of" (STL)



Ken Alverson
3/22/2004 7:54:49 AM
[quoted text, click to view]

Don't make us look it up, what is the text of error C2621?

Ken

tom_usenet
3/22/2004 1:00:29 PM
[quoted text, click to view]

if (wstring::npos !=

[quoted text, click to view]

I assume it's just the typo above causing the problem.

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
Stephen Howe
3/22/2004 2:33:19 PM
[quoted text, click to view]

And what is C2621? (I can't be bothered to look it up - you do the work -it
is your problem that you want help with).

Stephen Howe


Neo
3/22/2004 5:34:19 PM
Greetings!

I'm now building some VC6-compatible programs under VC7 (VS.NET 2003). Here
is my problem:

vector<wstring>::iterator itArgv;
// ......
if (basic_string<wstring>::npos !=
itArgv->find_first_of(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1)) // error C2621
{
// ......
}

Based on the header file "xstring", "find_first_of" returns "npos" when the
data specified cannot be found. How can I test the return value without
C2621?

Thanks in advance!

Neo


P.J. Plauger
3/22/2004 9:42:52 PM
[quoted text, click to view]

Perhaps you mean basic_string<wchar_t>. You can't have a
string each of whose elements is a wide-character string.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com

Neo
3/23/2004 9:31:00 AM
Sorry that I forgot to add my build log here.

============================================================================
===========================
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(1525)
: error C2621: member 'std::basic_string<_Elem>::_Bxty::_Buf' of union
'std::basic_string<_Elem>::_Bxty' has copy constructor
with
[
_Elem=std::wstring
]
and
[
_Elem=std::wstring
]
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(1527) : see reference to class template
instantiation 'std::basic_string<_Elem>::_Bxty' being compiled
with
[
_Elem=std::wstring
]
e:\projects\server\server.cpp(348) : see reference to class template
instantiation 'std::basic_string<_Elem>' being compiled
with
[
_Elem=std::wstring
]
============================================================================
================================

[quoted text, click to view]

Neo
3/23/2004 4:28:02 PM
Your explanation helped me out. Thank you!

Neo

[quoted text, click to view]

AddThis Social Bookmark Button