reserve, resize, how about something in between

J

Juha Nieminen

Bo Persson said:
Or, more likely, the host hardware might trap invalid values. I
believe that is the major reason for this being UB.

I don't think primitive types nor POD structs (ie. structs containing
only primitive types and other POD structs as members) *can* have invalid
values, no matter what you do (at least not in any hardware I know of).
Hence it's not possible for an uninitialized primitive type to cause
any kind of system signal to be thrown or whatever.

(But I suppose that the standard leaves it open for some exotic hardware
to support invalid values of 'int', for example.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top