Generic Functions with Multiple Generic Types | C++ Programming Video Tutorial

preview_player
Показать описание
In this c++ Video tutorial you will learn how to write a generic function which takes multiple generic type parameters.

You are gonna learn how to define a generic function to take multiple generic types of parameters, how to use the multiple types, how to pass different types of values to a function in detail with example.

Learn Programming in HINDI at our youtube channel

Catch us on SocialMedia
Рекомендации по теме
Комментарии
Автор

awesome brother, indeed anil shetty rocks :)

divineforever
Автор

I am trying to write function IIF(Condition, TruePart, FalsePart) like VB, Clipper/ FoxPro,
TruePart and FalsePart can be float* (array) or just float, also TruPart & FalsePart can be Null.
When all arguments/parameters are scalars (numbers) then resulting value is also a scalar (number). When any of arguments is an float array (array pointer) then function needs to return an array pointer. This is the most important part.
The Condition is Expression Like-
1) ArrayA > ArrayB 2) floatX > floatY ?, ArrayX < 10 .
.
Comparison of scalar type parameters is very with (x == y ? a : b)
But for float * (array pointer) each element of array is to be checked for TruePartArray & FalsePartArray
These are some examples
IIF(arrayA > ArrayB, ArrayX, ArrayZ)
IIF (ArrayA > 10, ArrayX, Null) // resulting array will be added with all Null(s) as FalsePart
IIF(ArrayX == FloatA, ArrayA, ArrayB)
IIF( FlatA >= FloaB, ArrayX, Array)

Condition is an expression so that is to be handled separately for Operator parsing and operator can be passed as string.
in that case it will be a function of 5 parameters i.e. IIF( ArrayX, "==", ArrayZ, ArrayA, Null) or IIF( floatX, ">=", floatY, floatC, Null)
Pl Let me know How to write Function Templet where Parameters can be float, float* or Null ?

abhimanyualtekar
Автор

Thank you, great tutorials!

Just- who is this Anjali?

TheOneGuru
Автор

plz make videos on data structure and algorithm...

ashishsinha
welcome to shbcf.ru