C++ ) Template
Template 값 또는 자료형의 집합을 매개변수로 하는 클래스 혹은 함수 Vector는 자료형에 상관없이 연속적인 값을 저장하는 컨테이너이다. 벡터와 내부 자료형은 독립적으로 표현 되어야하며, 템플릿을 사용해 인수를 지정하고 그에 따른 특정 타입과 함수를 생성할 수 있다. GoF에서 템플릿 메서드 패턴이란 Defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithms structure. 코드의 흐름을 상위 계층에서 정의하고, 하위 ..
2022.09.09