You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Clarification from Felix: We already have sys::size_of::<T>(), but you cannot use that in const-expressions. Thus the proposal that we grab sizeof as a keyword, so that we can incorporate it into an extension of the current set of const-expressions. At least, that's how Felix understands the situation.)
The text was updated successfully, but these errors were encountered:
C also has alignof (and alignas, but that would be an attribute) now. The offsetof implementation is just a macro in C and could likely be one in Rust too.
On Fri, Sep 20, 2013 at 02:41:21AM -0700, Daniel Micay wrote:
C also has alignof (and alignas, but that would be an attribute)
now.
Yes.
The offsetof implementation is just a macro in C and could likely
be one in Rust too.
Hmm, I considered that. I was thinking that it could not be a macro if
we wanted it to appear in constant expressions. But I guess that's not
true, since all the macro does is something like
&((T*)NULL)->f
which I believe is legal in our constant expressions -- or at least
might as well be legal in any world that permits sizeof in a
constant expression.
In that case, we don't need to reserve offsetof, except that it would
mean you write sizeof(T) (or whatever) but offsetof!(T,f). I guess
that's fine.
Nominating.
(Clarification from Felix: We already have
sys::size_of::<T>()
, but you cannot use that in const-expressions. Thus the proposal that we grabsizeof
as a keyword, so that we can incorporate it into an extension of the current set of const-expressions. At least, that's how Felix understands the situation.)The text was updated successfully, but these errors were encountered: