Boost logo

Boost :

Subject: Re: [boost] [review] Review of Outcome (starts Fri-19-May)
From: Peter Dimov (lists_at_[hidden])
Date: 2017-05-19 15:15:28


VS 2015, -Ox -Ob2:

; COMDAT ?f@@YA?AVerror_code_at_std@@XZ
_TEXT SEGMENT
___$ReturnUdt$ = 8 ; size = 4
?f@@YA?AVerror_code_at_std@@XZ PROC ; f, COMDAT

    push ebp
    mov ebp, esp
    call
??$_Immortalize_at_V_System_error_category_at_std@@@std@@YAAAV_System_error_category_at_0@XZ
; std::_Immortalize<std::_System_error_category>

    mov ecx, DWORD PTR ___$ReturnUdt$[ebp]
    mov DWORD PTR [ecx+4], eax

    mov eax, ecx

    mov DWORD PTR [ecx], 5

    pop ebp
    ret 0

That's update 3 though, things may have been different in u0..u2.

-----Original Message-----
From: Peter Dimov via Boost
Sent: Friday, May 19, 2017 18:01
To: boost_at_[hidden]
Cc: Peter Dimov
Subject: Re: [boost] [review] Review of Outcome (starts Fri-19-May)

Although that's VS 2017, and godbolt.org doesn't have 15. :-/

-----Original Message-----
From: Peter Dimov via Boost
Sent: Friday, May 19, 2017 17:59
To: boost_at_[hidden]
Cc: Peter Dimov
Subject: Re: [boost] [review] Review of Outcome (starts Fri-19-May)

> Would be nice if we could see that demonstrated on godbolt.org.

https://godbolt.org/g/QeHRpl

std::error_code f()
{
  return std::error_code( 5, std::system_category() );
}

->

___$ReturnUdt$ = 8 ; size = 4
f PROC
        call std::_Immortalize<std::_System_error_category>
        mov ecx, DWORD PTR ___$ReturnUdt$[esp-4]
        mov DWORD PTR [ecx+4], eax
        mov eax, ecx
        mov DWORD PTR [ecx], 5
        ret 0
f ENDP

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk