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


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

auto_ptr error is rather confusing


Hi,
  The following doesn't appear to compile using either 2.95.2 or 
CodeSourcery's splendid web snapshot machine (though the
diagnostics are very different).

  Yet Sun CC 5 and MSVC 6 both compile it without complaint.
  
  I'm quite prepared to believe that if I were smart enough
to be able to make sense of the X3J16/WG21 documentation, 
then it would be clear why I shouldn't expect it to work,
but perhaps then an improved diagnostic or a comment in
some documentation or something would be helpful.

Rgds

Anthony


#include <memory>
int main()
{
    std::auto_ptr<int> x;
    x = std::auto_ptr<int>(new int);
    return 0;
}

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