Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - std::error_code problem (QNX SDP 6.6.0): (1 Item)
   
std::error_code problem (QNX SDP 6.6.0)  
Hello.

i have an issue with std::error_code which lives in ${QNX_TARGET}/usr/include/cpp.
i think there are implementation errors:

* there is no non-member comparison operators.
* operator bool() is not an 'explicit' operator.
* system_error file includes some extra(?) operators (e.g., bool std::error_code::operator==(const std::error_code&) 
const)

as a result, i can't write code like following:

    enum error { NO_ERROR=0, SOME_ERROR };
    
    ...

    ec = some_func();
    if (ec == SOME_ERROR) // std::error_code should be constructed from enum and calls non-member comparison operator.
    {
        ...
    }

i tried to fix this problem and attached system_error file.
of course, i might have made the problem worse.
i think another header files patch (like http://www.qnx.com/download/feature.html?programid=26447) is needed.

any ideas are welcome.
Attachment: Text system_error 19.89 KB