rust/src/libstd
bors 1c2df5cc3c auto merge of #19640 : aliblong/rust/power_of_two_reform, r=Gankro
The `is_power_of_two()` method of the `UnsignedInt` trait currently returns `true` for `self == 0`. Zero is not a power of two, assuming an integral exponent `k >= 0`. I've therefore moved this functionality to the new method `is_power_of_two_or_zero()` and reformed `is_power_of_two()` to return false for `self == 0`.

To illustrate the usefulness of the existence of both functions, consider `HashMap`. Its capacity must be zero or a power of two; conversely, it also requires a (non-zero) power of two for key and val alignment.

Also, added a small amount of documentation regarding #18604.
2014-12-20 01:12:19 +00:00
..
collections auto merge of #19640 : aliblong/rust/power_of_two_reform, r=Gankro 2014-12-20 01:12:19 +00:00
comm libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
io libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
num auto merge of #19640 : aliblong/rust/power_of_two_reform, r=Gankro 2014-12-20 01:12:19 +00:00
path libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
rand libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
rt windows: remove unused import 2014-12-19 10:51:01 -05:00
sync Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
sys Rebasing fixes. 2014-12-18 23:35:53 -08:00
thread_local Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
time libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
ascii.rs libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
bitflags.rs libstd: convert BitFlags unops to by value 2014-12-18 15:02:28 -05:00
c_str.rs Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
c_vec.rs Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
dynamic_lib.rs libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
error.rs Utilize fewer reexports 2014-12-05 18:13:04 -05:00
failure.rs std: Move the panic flag to its own thread local 2014-12-18 23:35:52 -08:00
fmt.rs core: remove the dead function fmt::argumentstr. 2014-12-08 09:14:21 +02:00
hash.rs rollup merge of #19902: alexcrichton/second-pass-mem 2014-12-17 11:50:29 -08:00
lib.rs Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
macros.rs Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
os.rs libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
prelude.rs std: Collapse SlicePrelude traits 2014-12-14 19:03:56 -08:00
rtdeps.rs libs: merge librustrt into libstd 2014-12-18 23:31:34 -08:00
task.rs Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
thread.rs std: Move the panic flag to its own thread local 2014-12-18 23:35:52 -08:00
thunk.rs Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00