What’s the scope of inline friend functions?

When you declare a friend function with an unqualified id in a class it names a function in the nearest enclosing namespace scope. If that function hasn’t previously been declared then the friend declaration doesn’t make that function visible in that scope for normal lookup. It does make the declared function visible to argument-dependent lookup. … Read more

Display a few words in different colors in Flutter

Use RichText class var text = new RichText( text: new TextSpan( // Note: Styles for TextSpans must be explicitly defined. // Child text spans will inherit styles from parent style: new TextStyle( fontSize: 14.0, color: Colors.black, ), children: <TextSpan>[ new TextSpan(text: ‘Hello’), new TextSpan(text: ‘World’, style: new TextStyle(fontWeight: FontWeight.bold)), ], ), );

What does __inline__ mean ?

__inline__ is a non-standard extension. Typically, it tells the compiler: “inline this function”, but being a non-standard extension we can’t say with certainty unless we know which compiler this is on. To inline is to remove the function call and place it’s contents directly where the call would be made. This often removes the overhead … Read more

When should I (and should I not) use Scala’s @inline annotation?

Never @inline anything whose implementation might reasonably change and which is going to be a public part of a library. When I say “implementation change” I mean that the logic actually might change. For example: object TradeComparator extends java.lang.Comparator[Trade] { @inline def compare(t1 : Trade, t2 : Trade) Int = t1.time compare t2.time } Let’s … Read more

Inline function v. Macro in C — What’s the Overhead (Memory/Speed)?

Calling an inline function may or may not generate a function call, which typically incurs a very small amount of overhead. The exact situations under which an inline function actually gets inlined vary depending on the compiler; most make a good-faith effort to inline small functions (at least when optimization is enabled), but there is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)