What Is Generic Programming?

The original motivation for Generic Programming was simple and straightforward: to invent a language mechanism that could help implement a universal standard container library. The so-called universal standard container library is to be able to do things such as using a List class to store all possible types of objects; generic programming allows you to write completely general and reusable algorithms, which are efficient and specific to a specific The algorithms for the data types are the same. Generic refers to the meaning that can be operated on a variety of data types, similar to templates. STL is huge and can be extended. It contains many basic computer algorithms and data structures, and completely separates algorithms from data structures. Among them, algorithms are generic and not tied to any particular data structure or object type.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?