'템플릿'에 해당되는 글 1건

  1. 2010.05.09 Templates

역시나 이번에도 번역겸 요약이다.

Microsoft Visual Studio 2010 Help Libarary를 참고하여 작성됨을 미리 밝혀둡니다.
저작권 등 문제가 된다면 꼭 메일 주세요!! 바로 삭제나 블라인드 조치 취하겠습니다. asgawa@gmail.com

Templates(이하 템플릿)

C++ 템플릿은 함수나 클래스의 구성을 정의할 수 있게 하며, 이는 유동적인 자료형(런타임 중 어느것이 결정될지 모르는)을 가진 함수나 클래스가 연산을 할 수 있게 한다. C++ 템플릿을 사용하는 Microsoft 도구는 ISO/ANSI C++ 기준을 따르고 있다.

자료형만 다르고 동일한 코드의 통합이 목표인 상황에서 템플릿을 사용하라.

1. 같은 알고리즘을 적용할 함수이고, 자료형만 다르게 적용하기를 요구하는 함수를 만들 때
2. typesafe class(자료형에 관해 안전한 클래스) 집합을 개발할 때

템플릿은 때때로 C 언어의 매크로와 void형 포인터보다 더 좋은 해결책이 되기도 하며, collections(MFC에서 템플릿이 사용되는 main중 하나)나 스마트 포인터로 작업을 할 때 특히 유용하다.



앞으로 추가될 내용들

Overview
   Provides general information about templates, or parameterized types, in Visual C++.
Specifications
   Provides a specification for a template declaration.
Advantages of Templates
   Describes advantages of C++ templates. 
typename
   Describes the typename keyword.
Referencing Templates [C++ Language]
   Provides a task showing how to reference templates in your code.
Angle Bracket Placement
   Describes how angle brackets are placed in templates.
Differences from Other Implementations
   Discusses Microsoft-specific implementations of templates.
Name Resolution
   Discusses the three types of names in template definitions.
Class Templates
   Describes how to use and work with class templates.
Function Templates
   Describes how to use and work with function templates.

 

'Programming Languages > C++ Templates' 카테고리의 다른 글

Advantages of Templates [C++]  (0) 2010.08.31
Template Specifications  (0) 2010.05.10
Templates Overview  (0) 2010.05.10
Posted by 독뽀
,