Articles/How generic programming is implemented in C++
C++ have been supporting the IT Generic Concepts through its various features and template system. Still, to completely use the concepts of Generic Programming, one must use a variety of template techniques. Some of these techniques used by nearly all generic libraries written in C++ are:
Concepts: Concepts do not have direct representations in C++, therefore, they are only represented within the documentation for a generic library. They are often documented as a set of requirements consisting of valid expressions, associated types, invariants and complexity guarantees.
Algorithms:IT Generic Concepts can be implemented using genetic algorithms with C++ Templates. Although they do not provide much type checking at the point of definition, they are type safe at the point of instantiation offering uncompromising performance.
Tag Dispatching: This is a method of using the concept of function overloading to build IT Generic Concepts. Tag Dispatching is used hand-in hand with traits classes for the purpose of generic programming.
Adapters: An adapter is a class template which builds on another type to offer a new interface or behavioral variant. Adaptors are used in IT Generic Concepts when a concept is to be modeled by a type or set of types with incompatible interfaces.
Concept Checking: This is a method to detect errors while using the above discussed templates for IT Generic Concepts in C++. They attempt to produce more readable error messages for users.
There is a lot more to IT Generic Concepts that can be used for generic programming. And there many ways and tricks that can be mastered to become an expert in this domain. Livewire, an important and powerful arm of CADD Centre for Training and Development offers a set of courses where you can master the IT Generic Concepts in C++ programming and become a pro to meet the industry challenges.
LIVEWIRE promote niche training in IT, Electronics & Electricals creating experts for emerging technology industries and specialist technology jobs. A part of CADD Centre, which is Asia's largest CAD/CAM/CAE training institute, LIVEWIRE is present in 100 locations across India and 6 Countries.