エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
特集 C# 2.0新機能徹底解説(前編) ― 開発生産性を飛躍的に高めるジェネリック(4/4) - @IT
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
特集 C# 2.0新機能徹底解説(前編) ― 開発生産性を飛躍的に高めるジェネリック(4/4) - @IT
public static class ConvertIfHelper<T,U> { private class InnerConvertIf { public List<U> temp = n... public static class ConvertIfHelper<T,U> { private class InnerConvertIf { public List<U> temp = new List<U>(); Predicate<T> pred; Converter<T, U> cvtr; internal InnerConvertIf(Predicate<T> pred,Converter<T, U> cvtr) { this.pred = pred; this.cvtr = cvtr; } public void ConvertIfAction(T that) { if(pred(that)) temp.Add(cvtr(that)); } } static public List<U> ConvertIf(List<T> from, Predicate<T> pred,