C++ Logo

std-proposals

Advanced search

Re: Allowing access to object representations

From: sdkrystian <sdkrystian_at_[hidden]>
Date: Sat, 17 Aug 2019 19:42:29 -0400
You're right, there wouldn't be unless I specified that the object representation is considered to be an array if the type is a contiguous layout type, which I did.Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: Language Lawyer via Std-Proposals <std-proposals_at_[hidden]> Date: 8/17/19 18:58 (GMT-05:00) To: std-proposals_at_[hidden] Cc: Language Lawyer <language.lawyer_at_[hidden]> Subject: Re: [std-proposals] Allowing access to object representations You propose:> Insert a new paragraph below [expr.reinterpret.cast] p6> A prvalue v of object pointer type "pointer to cv1 T1" pointing to an object a can be explicitly converted to an object pointer of a different type "pointer to cv2 T2", where cv2 is the same cv-qualification as, or greater cv-qualification than cv1, the result of which is defined as follows:> — f T1 is a contiguous-layout type and T2 is unsigned char, char or std::byte, the result is a pointer to the first element of the object representation of a.Is there much sense in specifying casts to `char` or `std::byte` as giving a pointer to the first element of the object representation?You won't be able to use it for pointer arithmetic.-- Std-Proposals mailing listStd-Proposals_at_[hidden]://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2019-08-17 18:44:34