Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compilation error: no matching function for call to



//----------------

typedef std::basic_string < wchar_t > SHWideString;
bool GetItemsByName( SHWideString& wsItemName, std::list<SHItem*>& INamed );


//----------------


I made one call to the above function in the following way..


//----------------

std::list<SHItem*>      lNamed;

pFmWnd->GetItemsByName( SHWideString(L"ItemSwitch"), lNamed );

//---------------

but the compilation error i am getting is ...

error: no matching function for call to 'GetItemsByName(SHWideString,
std::list<SHItem*, std::allocator<SHItem*> >&)'

You can't pass a temporary to the first argument of GetItemsByName as the the first argument isn't declared const. The mac compiler is correct, the windows compiler is not correct according to the standard.

Change your code to:

SHWideString itemSwitch (L"ItemSwitch")
pFmWnd->GetItemsByName (itemSwitch, lNamed);

Ashley.
--
Ashley Sanders               email@hidden
Copac http://copac.ac.uk A MIMAS Service funded by JISC
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden
References: 
 >compilation error: no matching function for call to (From: Aby <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.