Generic programming


Generic programming

Swift문법 Generic programming abcde621 2018. 11. 26. 11:36 이웃추가 본문 기타 기능 0.출처 https://en.wikipedia.org/wiki/Generic_programming types to-be-specified-later 자료형을 나중에 결정하겠다. 데이터 형식에 의존하지 않고, 하나의 값이 여러 다른 데이터 타입들을 가질 수 있는 기술에 중점을 두어 재사용성을 높일 수 있는 프로그래밍 방식입니다. //c++ template <typename T> T max(T x, T y) { return x < y ? y : x; } //java using System; class Sample { static void Main() { int[] array = { 0, 1, 2, 3 }; MakeAtLeast<int>(array, 2); // Change array to { 2, 2, 2, 3 } foreach (int i in array) C...



원문링크 : Generic programming