std::exception_ptr only partially comparable to null - by Alf P. Steinbach, except MS doesn't accept it

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 727374 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 2/29/2012 4:23:17 PM
Access Restriction Public


As of Visual C++ 10.0,

#include <exception>

int main()
    std::exception_ptr const    p   = std::current_exception();
    (p == nullptr);             // OK
    (p != nullptr);             // Bah!
    (p == 0);                   // OK
    (p != 0);                   // Nix!
    (!!p);                      // Nyet!
    (static_cast<bool>( p ));   // Nope!
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:24 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by Microsoft on 3/1/2012 at 6:54 PM

Thanks for reporting this bug. It was previously reported to us at and the fix is available in the VC11 Beta.

If you have any further questions, feel free to E-mail me at .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by EricLeong [Feedback Moderator] on 2/29/2012 at 7:23 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 2/29/2012 at 6:42 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(