This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] std::string(0);


On Jun 11, 2004, at 10:51 AM, Daniel Frey wrote:

Martin Sebor wrote:
A conforming implementation is not allowed to reject constructs
such as std::string (0) just because they might cause undefined
behavior at runtime. Consider this well-formed program:
    #include <string>
    int main () {
        if (0) std::string (0);
    }
Martin

OK, so this means we can't go the "easy" way. The remaining options are (AFAICS):


a) Change the standard, make the above example illegal. Unlikely.

I have added this to the list of library issues. We'll see what the LWG says about it in Redmond.


--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]