object representation and char objects

64 views
Skip to first unread message

barry....@gmail.com

unread,
Oct 18, 2016, 11:16:17 AM10/18/16
to ISO C++ Standard - Discussion
In N4606, the definition of object representation reads (emphasis mine):

The object representation of an object of type T is the sequence of N unsigned char objects taken up by the object of type T, where N equals sizeof(T).

Should it really be unsigned char objects?  That doesn't seem to me to fit the usage of the term generally. Would it make more sense to just define the representation as a sequence of N unsigned chars? 

barry....@gmail.com

unread,
Oct 18, 2016, 11:42:20 AM10/18/16
to ISO C++ Standard - Discussion, barry....@gmail.com
This is apparently CWG 1701. I'm only a few years late on this question.  

Victor Dyachenko

unread,
Oct 19, 2016, 7:25:29 AM10/19/16
to ISO C++ Standard - Discussion, barry....@gmail.com
ISO C++14:
1.8 The C++ object model [intro.object]

... An object is a region of storage. ...

So unsigned char variable is an object.

Richard Smith

unread,
Oct 19, 2016, 4:02:41 PM10/19/16
to std-dis...@isocpp.org, Barry Revzin
That text has been rewritten in more recent drafts.

Victor Dyachenko

unread,
Oct 20, 2016, 2:38:16 AM10/20/16
to ISO C++ Standard - Discussion, barry....@gmail.com
Really? What was the motivation? AFAIK this text used to be the same since ANSI C.

Richard Smith

unread,
Oct 20, 2016, 3:49:41 AM10/20/16
to std-dis...@isocpp.org, Barry Revzin
In C++, objects and the storage they occupy are two separate concepts. Objects exist at a higher level of abstraction than storage. 
Reply all
Reply to author
Forward
0 new messages