Re: compilation error: no matching function for call to
Re: compilation error: no matching function for call to
- Subject: Re: compilation error: no matching function for call to
- From: Steve Checkoway <email@hidden>
- Date: Tue, 15 Aug 2006 05:49:01 -0700
On Aug 15, 2006, at 2:22 AM, Paul Walmsley wrote:
typedef std::basic_string < wchar_t > SHWideString;
bool GetItemsByName( SHWideString& wsItemName,
std::list<SHItem*>& INamed );
pFmWnd->GetItemsByName( SHWideString(L"ItemSwitch"), lNamed );
You are calling a function that takes a non-const reference, but
you're constructing a value on the stack. This is not permitted
(VS.Net will let you do it, but it gives you a warning). Try
making GetItemsByName() take a const string reference instead.
The problem isn't that it's being created on the stack but that it's
a temporary.
SHWideString s( L"ItemSwitch" );
pFmWnd->GetItemsByName( s, lNamed );
would work. The correct thing to do is still to make it a const
reference (or not a reference at all).
Also, std::wstring should already be a typedef for
std::basic_string<wchar_t>, iirc.
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden