- インライン関数の正体
Kotlinのラムダ式は無名クラスを生成します。つまりラムダ式を使えば使うほど無名クラスが増えていくということになります。簡単な処理のためだけにどんどん無名クラスを増やしてしまうのは避けたいところです。そこでインライン関数を使います。
* inline修飾子とは
inline修飾子は主に関数を引数に持つ関数に使われる修飾子です。
Go to list of users who liked
More than 5 years have passed since last update.
Kotlinのラムダ式は無名クラスを生成します。つまりラムダ式を使えば使うほど無名クラスが増えていくということになります。簡単な処理のためだけにどんどん無名クラスを増やしてしまうのは避けたいところです。そこでインライン関数を使います。
* inline修飾子とは
inline修飾子は主に関数を引数に持つ関数に使われる修飾子です。
Register as a new user and use Qiita more conveniently
Go to list of users who liked