first last target last templatetypename Itertator typename T
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-1.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-2.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-3.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-4.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-5.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-6.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-7.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-8.jpg)
![first 以上 last 未満 の範囲から target を探す (見つからなければlastを返す) template<typename Itertator, typename T> Iterator find(Iterator first 以上 last 未満 の範囲から target を探す (見つからなければlastを返す) template<typename Itertator, typename T> Iterator find(Iterator](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-9.jpg)
![template<typename Itertator, typename T> Iterator find(Iterator first, Iterator last, T target) { while ( template<typename Itertator, typename T> Iterator find(Iterator first, Iterator last, T target) { while (](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-10.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-11.jpg)
![#include <cliext/vector> #include <cliext/list> #include <cliext/algorithm> using namespace cliext; vector<int> iv; // intを要素とする可変長配列 list<String^> #include <cliext/vector> #include <cliext/list> #include <cliext/algorithm> using namespace cliext; vector<int> iv; // intを要素とする可変長配列 list<String^>](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-12.jpg)
![C# で Generic Programming IEnumerable<T> で、データ/コレクションにかかわらず列挙できる。 List<int> il; Linked. List<string> sll; char[] ca; foreach ( C# で Generic Programming IEnumerable<T> で、データ/コレクションにかかわらず列挙できる。 List<int> il; Linked. List<string> sll; char[] ca; foreach (](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-13.jpg)
![C# で Generic Programming public class Enums { public static IEnumerable<T> Select(IEnumerable<T> e, Predicate<T> p) C# で Generic Programming public class Enums { public static IEnumerable<T> Select(IEnumerable<T> e, Predicate<T> p)](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-14.jpg)
![C# で Generic Programming Static bool Is. Even(int n) { return n % 2 == C# で Generic Programming Static bool Is. Even(int n) { return n % 2 ==](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-15.jpg)
- Slides: 15
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-1.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-2.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-3.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-4.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-5.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-6.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-7.jpg)
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-8.jpg)
![first 以上 last 未満 の範囲から target を探す 見つからなければlastを返す templatetypename Itertator typename T Iterator findIterator first 以上 last 未満 の範囲から target を探す (見つからなければlastを返す) template<typename Itertator, typename T> Iterator find(Iterator](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-9.jpg)
first 以上 last 未満 の範囲から target を探す (見つからなければlastを返す) template<typename Itertator, typename T> Iterator find(Iterator first, Iterator last, T target) { while ( first != last ) { if ( *first == target ) { break; } アルゴリズムは データ型とデータ構造に対して自由になった! ++first; } return first; } わんくま同盟 東京勉強会 #8
![templatetypename Itertator typename T Iterator findIterator first Iterator last T target while template<typename Itertator, typename T> Iterator find(Iterator first, Iterator last, T target) { while (](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-10.jpg)
template<typename Itertator, typename T> Iterator find(Iterator first, Iterator last, T target) { while ( first != last ) { if ( *first == target ) { break; Iteratorは: } ++first; • != で比較できる } • * で要素を取り出せる return first; • ++ で次に進めることができる } ならどんなものでもかまわない わんくま同盟 東京勉強会 #8
![](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-11.jpg)
![include cliextvector include cliextlist include cliextalgorithm using namespace cliext vectorint iv intを要素とする可変長配列 listString #include <cliext/vector> #include <cliext/list> #include <cliext/algorithm> using namespace cliext; vector<int> iv; // intを要素とする可変長配列 list<String^>](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-12.jpg)
#include <cliext/vector> #include <cliext/list> #include <cliext/algorithm> using namespace cliext; vector<int> iv; // intを要素とする可変長配列 list<String^> sl; // String^を要素とする双方向リスト // データ/コンテナにかかわらず find できる♪ vector<int>: : iterator iiv = find(iv. begin(), iv. end(), 5); list<String^>: : iterator isl = find(sl. begin(), sl. end(), “five”); わんくま同盟 東京勉強会 #8
![C で Generic Programming IEnumerableT でデータコレクションにかかわらず列挙できる Listint il Linked Liststring sll char ca foreach C# で Generic Programming IEnumerable<T> で、データ/コレクションにかかわらず列挙できる。 List<int> il; Linked. List<string> sll; char[] ca; foreach (](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-13.jpg)
C# で Generic Programming IEnumerable<T> で、データ/コレクションにかかわらず列挙できる。 List<int> il; Linked. List<string> sll; char[] ca; foreach ( int item in il ) { … } foreach (string item in sll ) { … } それぞれの Ienumerable<T> foreach ( char item in ca ) { … } に対して • bool Move. Next() • T Current { get; } できるから。 わんくま同盟 東京勉強会 #8
![C で Generic Programming public class Enums public static IEnumerableT SelectIEnumerableT e PredicateT p C# で Generic Programming public class Enums { public static IEnumerable<T> Select(IEnumerable<T> e, Predicate<T> p)](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-14.jpg)
C# で Generic Programming public class Enums { public static IEnumerable<T> Select(IEnumerable<T> e, Predicate<T> p) { foreach ( T item in e ) { if ( p(item) ) { yield return item; } } なんてのを定義すれば… わんくま同盟 東京勉強会 #8
![C で Generic Programming Static bool Is Evenint n return n 2 C# で Generic Programming Static bool Is. Even(int n) { return n % 2 ==](https://slidetodoc.com/presentation_image/07afe55142fb011f9deb1b81a995eec1/image-15.jpg)
C# で Generic Programming Static bool Is. Even(int n) { return n % 2 == 0; } List<int> il; Linked. List<int> ill; Int[] ia; // 偶数のみを列挙する foreach ( int item in Enums. Select<int>(il, Is. Even) { Console. Write. Line(item); } ill でも ia でも、IEnumerable<int>でさえあれば。 // 偶数のみを抽出する List<int> evens = new List<int>(Enums. Select<int>(il, Is. Even)) わんくま同盟 東京勉強会 #8
Primary target market and secondary target market
Author surname and initials example
First last
First last
First last
First.m.last format
What is foil math
Preamble bits
First name last name tpu
Maturity continuum
Breadth first vs depth first
Sdl first vs code first
Habit 3 lesson plans
Habit 3 put first things first
Entity framework 7 release date
First to invent or first to file