• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: compilation error: no matching function for call to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >compilation error: no matching function for call to (From: Aby <email@hidden>)
 >Re: compilation error: no matching function for call to (From: Paul Walmsley <email@hidden>)

  • Prev by Date: Re: compilation error: no matching function for call to
  • Next by Date: Re: -Wshorten-64-to-32 and LL suffix
  • Previous by thread: Re: compilation error: no matching function for call to
  • Next by thread: debugging an scons based project?
  • Index(es):
    • Date
    • Thread