Visual Studio 2008 to Visual Studio 11 Beta std::bad_alloc Constructor Goes Private

Discussion Visual Studio 2008 to Visual Studio 11 Beta std::bad_alloc Constructor Goes Private

  • terça-feira, 13 de março de 2012 18:24
     
     

    std::bad_alloc's constructors have changed from Visual Studio 2008 to Visual Studio 11 beta. The constructor that accepts a user-supplied message has moved from public to private. Is this a deliberate change? Was I just using the library wrong in 2008? Or should the constructor really be public?

Todas as Respostas

  • terça-feira, 13 de março de 2012 18:42
     
     

    On 3/13/2012 2:24 PM, TheArtTrooper wrote:

    std::bad_alloc's constructors have changed from Visual Studio 2008 to
    Visual Studio 11 beta. The constructor that accepts a user-supplied
    message has moved from public to private. Is this a deliberate
    change? Was I just using the library wrong in 2008? Or should the
    constructor really be public?

    The C++ standard mandates a default constructor and a copy constructor for bad_alloc. Any other constructor is an implementation-specific extension.


    Igor Tandetnik

  • terça-feira, 13 de março de 2012 20:31
     
     
    Thanks for the quick answer Igor.