Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2012, 09:01 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

My guess...

The list returned from MoveItemToCorpse is a temporary since it isn't being assigned to anything, and a temporary can't bind to the non-const reference that merge takes as a parameter.

To fix it, assign the temporary to a local variable and pass that to merge.

I'd also guess that Visual Studio may be warning about a non-standard extension there, but it's lost in the sea of other warnings in the project. It may also only show up at warning level 4. The error may also be different in debug versus release since that might change any elided copies from the return.
Reply With Quote
  #2  
Old 08-28-2012, 09:24 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Looks like there's a warning at level 4 in Visual Studio 2008, but not at level 3.

Code:
#include <list>

typedef std::list<int> IntList;

IntList DoSomething()
{
	IntList RetVal;
	return RetVal;
}

int main()
{
	IntList List;
	List.merge( DoSomething() );
	return 0;
}
Code:
warning C4239: nonstandard extension used : 'argument' : conversion from 'IntList' to 'std::list<_Ty> &'
        with
        [
            _Ty=int
        ]
        A non-const reference may only be bound to an lvalue
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:48 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3