FAQ

if you want to use & extensively, why not just use uint8?
a bool will not be smaller than an uint8 (and operations on it
certainly
won't be faster than that on uint8).
I don't care about the size. Also, uint8 is semantically different from
a bool.
(no, the spec doesn't allow implementation of bool as a real 1-bit
integer
as "for a variable x of any type: unsafe.Alignof(x) is at least 1")
I didn't say "Implement bool as a one bit integer"; I said "Implement
bool as if it was a one bit integer". That is, the semantics of bitwise
operations should work that way. If I recall correctly, Go even defines
the conversion from bool to int as true -> 1 and false -> 0.



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 10 of 21 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 1, '13 at 7:02p
activeMar 3, '13 at 2:38a
posts21
users9
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase