@MikeLaPenta@YargerAllyn@The_Diablo13 6 / x(1+x)
= 6 / (x + x^2)
Let x = 2. Answer is 1.
If it were (6/x)(1 + x), then you'd have (6 / x) + 6.
But x(1+2) is the denominator, else we'd write it as 6(1+x)/x.
@P88044770@10xMikasa@straceX It usually just reorders basic blocks so the likely branch is the fallthrogh case or branch backwards (which the CPU predicts as taken on cold branch). The unlikely case is the branch taken forwards (predicted as branch not taken on cold branch).
@relizarov Microsoft Dynamics doesn't include the end of the range either. I've seen people lose sales because they had filters like SO0000..SO0999 then SO1000..SO1999 etc. Every *999 sales order got missed by the filters.
@dg_512@wangzhr4 No, UCS-2 is fixed width. It's basically the subset of UTF-16 which does not encode surrogates, so it cannot encode any codepoint beyond \uFFFF.
@Dark_Goldenrod@wangzhr4 Uh, UTF-16 can work with either big or little endian.
Searching UTF-8 or UTF-16 can be done just by searching the code unit sequence - both encodings are self-synchronizing.
@dg_512@wangzhr4 UTF-16 isn't really any simpler. It's still a variable width encoding (2 or 4 bytes) - you have to check any code unit starting `0xD` for a surrogate.
UCS-2 is much simpler, if you limit yourself to the basic multilingual plane.
UTF-16 was designed for backward compat with UCS2
@valigo@platoff Can also be extended to support multiple type parameters by treating them as "tuples" and using a recursive macro. I use 'แฎ' in place of comma as it's valid in identifiers.
https://t.co/mTVUC2sx3x
@valigo@platoff This basically does that but you don't have to type it - you just say:
instance(List, T)
instance(List, List(T))
foo(List(List(T)))
It hides the typedef names. Could use any mangling scheme really, but the Go meme mangling scheme is nice and readable.
@valigo@platoff If you *need* it to you can stick __attribute__((always_inline)) on it.
But it's not the same as the C++ one anyway. A more similar version for C would use _Generic.
https://t.co/LnoMUieJoa
@valigo@platoff Chances are a C compiler will inline and remove the `if` anyway, even in the `non_const_serialize" example due to constant propagation.
If you wanted to disallow the non_const for whatever reason, trivially done by inserting a `static_assert`.
eg: https://t.co/hdAB018aSg
@_FaceFTW@valigo long == long long on most targets.
SYSV (LP64) could just promote `long long` to 128-bits.
But then `intmax_t` would be less than the largest integer type because glibc is retarded and typedefs `intmax_t` as `long`.