Why is this F# code so slow?

The problem is that the min3 function is compiled as a generic function that uses generic comparison (I thought this uses just IComparable, but it is actually more complicated – it would use structural comparison for F# types and it’s fairly complex logic). > let min3(a, b, c) = min a (min b c);; val … Read more

friend AND inline method, what’s the point ?

friend inline bool operator==(MonitorObjectString& lhs, MonitorObjectString& rhs) { return(lhs.fVal==rhs.fVal); } is sometimes called friend definition, because it is a friend declaration that also defines the function. It will define the function as a non-member function of the namespace surrounding the class it appears in. Actually, the inline there is redundant: It’s implicitly declared inline if … Read more

display:block inside display:inline

when i read the spec, i find your question actually quite well answered: When an inline box contains a block box, the inline box […] [is] broken around the block. The [in]line boxes before the break and after the break are enclosed in anonymous boxes, and the block box becomes a sibling of those anonymous … Read more

When to use the inline function and when not to use it?

Avoiding the cost of a function call is only half the story. do: use inline instead of #define very small functions are good candidates for inline: faster code and smaller executables (more chances to stay in the code cache) the function is small and called very often don’t: large functions: leads to larger executables, which … Read more