I hereby claim:
- I am robbepop on github.
- I am herobird (https://keybase.io/herobird) on keybase.
- I have a public key ASAqEVoi9VO42oPAQHmY21kujCqXIk70xe2RkiwyyGAXhAo
To claim this, I am signing this object:
| #include <iostream> | |
| template<typename T> | |
| void print_counted_acc(size_t acc, T head) { | |
| std::cout << acc << ' ' << head << '\n'; | |
| } | |
| template<typename T, typename... Args> | |
| void print_counted_acc(size_t acc, T head, Args... tail) { | |
| std::cout << acc << ' ' << head << '\n'; |
| #include <cstdint> | |
| #include <cstddef> | |
| namespace explicit_types { | |
| //==================================================================================== | |
| // Operator definitions for signed int types | |
| //==================================================================================== | |
| constexpr auto operator"" _i8 (unsigned long long value) noexcept -> int8_t { return value; } | |
| constexpr auto operator"" _i16(unsigned long long value) noexcept -> int16_t { return value; } |
| use std::rc::Rc; | |
| use std::cell::Cell; | |
| use std::cell::RefCell; | |
| use std::ops::Add; | |
| use std::ops::Sub; | |
| use std::ops::Range; | |
| use std::fmt; |
| # ---------------------------------------------------------------------------------- | |
| # r u s t f m t - C O N F I G | |
| # ================================================================================== | |
| # | |
| # Version: 0.7.1 | |
| # Author : Robbepop <robbepop@web.de> | |
| # | |
| # A predefined .rustfmt.toml file with all configuration options and their | |
| # associated description, possible values and default values for use in other | |
| # projects. |
| // Multiplication by a constant can be replaced by multiple shift and addition operations: | |
| // The following table shows that for constants from 1 to 36. | |
| // | |
| // ============================================================================ | |
| // N | Factorized | # Ops | Ops with x as input | |
| // ---------------------------------------------------------------------------- | |
| // 1 | 1 | 0 | x | |
| // 2 | 2 | 1 | x << 1 | |
| // 3 | 2 + 1 | 2 | x << 1 + x | |
| // 4 | 4 | 1 | x << 2 |
| use ast2::prelude::*; | |
| use simplifier::prelude::*; | |
| pub mod prelude { | |
| pub use super::BoolReducer; | |
| } | |
| /// This simplification procedure dissolves symbolic tautologies or contradictions | |
| /// for boolean expressions. | |
| /// |
I hereby claim:
To claim this, I am signing this object:
| fn const_next_power_of_two(ty: TokenStream2, value: TokenStream2) -> TokenStream2 { | |
| quote! {{ | |
| if (#value) <= 1 { | |
| 0 | |
| } else { | |
| let p = (#value) - 1; | |
| let z = p.leading_zeros(); | |
| <#ty>::MAX as usize >> z | |
| } | |
| }} |