C++ programming language, just like a regular English language, has concept of “genericity”. For instance, the word “bank“, in English, is generic in the sense that the word can mean an institution (noun) or an activity (verb). The meaning is inferred from the context of the word usage.
Genericity introduces certain degree of flexibility in the language. The flexibility covers etymologically related or even, in some cases, unrelated meanings (or links?). For instance, “bank” may refer to financial institution as a noun or, related activity as a verb, or edge of a river as an unrelated (to the institution) noun. Basically, genericity can be viewed as minimizing the vocabulary and maximizing the utility or means to control the complexity of a language.
Similarly, in C++ language, there is a notion of generic programming which is implemented by using templates. Consider the following C++ code
template<typename T>void Exchange(T& a, T& b){ T temp = a; a = b; b = temp;}
This function, Exchange, can be used for floats or ints alike to exchange the value like so
int a = 10;int b = 20;float c = 100;float d = 200;Exchange(a, b); // a becomes 20 and b becomes 10Exchange(c, d); // c becomes 200 and d becomes 100
Note how the function Exchange is used for both ints and floats type. Based on the context, int and float calls, compiler generates two copies of Exchange function, one each for int and float type respectively, using which the values of variables are exchanged.
Hi sir,
My name is Riyaz. First of all, I would like to introduce myself briefly. I have had a deep interest in cinema since my childhood. From the time I was studying in 3rd or 4th standard, I would look at movie posters and imagine the story behind them in my own way. I come from a very religious family. I was brought up in a strict environment where we were not even allowed to watch television at home. Despite that, my passion for cinema never faded. For example, when the movie Bombay was released, I looked at the poster and, even at that young age, imagined and narrated what the story could be. Similarly, while I was still in school, I would often predict what might happen next in certain TV serials. Even my tuition teacher used to call me “Director.” However, because of my family circumstances, I could not enter the film industry. After completing my education, I pursued different fields. I worked in Malaysia and later started and managed restaurant businesses in the OMR and ECR areas of Chennai. During the COVID period, I had to close those businesses and moved to Dubai, where I also continued in the restaurant business. Today, I have more than 6 stories that I have developed and kept with me over the years. Each story belongs to a different genre. I also have some stories that particularly focus on women and their experiences. Although I have always had a strong desire to become a film director, I have never had the right opportunity to bring my ideas to life. However, I strongly believe that the stories I have created deserve to reach the right person and, hopefully, become meaningful films. That is the reason I am trying to contact you, sir. If possible, I kindly request you to share your contact number or let me know how I can meet you in person. I would really like to meet you personally and explain my stories and ideas to you in detail. If you like my concepts and give me an opportunity, it would mean a lot to me and would make me extremely happy. I am also planning to return to Dubai soon. Considering the current situation here, I am deciding whether to continue my business here or leave for Dubai. Before I leave, I would really like to meet you at least once and discuss my stories with you. Sir, please give me one opportunity to tell you my stories. Even that opportunity itself would make me very happy. I sincerely look forward to hearing from you.
Thank you very much, sir.
With warm regards,
Riyaz
994488510