High These are things of the heart once again welcome to the next video of the series of course in fundamentals.
Now in this video of a talk about how do we use the infix function in Gears of Cartland.
So in Cartland we have one word or concept of infix function which is actually the member function or
the extension function in case of Cartland.
So the infix function can be a member function or the extension function and their properties are.
They just contained a single bit.
And they have a prefix of infix.
So let's check out how do we use the infix function in Cartland.
Now in the previous video we talked about the extension function.
So these were all the extension function in case of Cartland.
Now suppose I said the infix function all in fixed function or extension function but all extension
functions are not infix function which means that here I have to extension function.
So it is not necessary that these two can be declared as the infix function.
What I am saying is.
Suppose if I use the prefix of infix And here again infix.
So here you can notice this Metford did not show any error.
But this method is showing some error.
Let's figure it out.
It says that the infix Mortified is inapplicable on this function because this function has stupid ammeters
and it is the property of the infix function and they should only contain one paramita.
Right.
So this method is now the infix in nature.
So there doesn't need a command line you can call it infix function and also you can call it extension
function.
Right.
But this method can only be extension functions not the infix function.
So we have to remove this infix keyword.
Right.
So here let us remove it.
As of now because this video is about the infix function right.
So it doesn't move it.
And always remember the infix function only going down one parameter.
So that's why I remove that mattered.
And now at the top layer doesn't it move these string lines.
Right now I suppose if I add in the code right now then.
Then also we will get the same output as we got in the previous value.
So let's check it out.
So here we go.
Good.
Then as the output.
So with or without the infix key word Our code is again working perfectly fine.
Later check it out again.
Let's verify it.
So there we go again we get 10.
Now you must be thinking What is the benefit of using the infix keyword.
Why don't we simply use the extension function as a plain function and just move on.
Right but the thing is that if you use the infix keyword here then while calling the function such as
the reader value you can simply call X space greater value and then simply give a space.
Now this is the usage of the infix function you can simply use X space greater value space like.
And this method will be triggered present inside this file.
Right but if you make it just the extension function then this syntax will not be applicable.
Now Dom would benefit of the infix function.
Check it out in our operator overloading which we will go with.
In our upcoming voodoos.
Right.
So as of now let us run the code.
So here we go.
Then again in the output.
So the infix function also increases the readability of the code.
Right.
So at the end you can see X greater value Y is actually the same as X and d'arte greater value.
So both are exactly the same.
Now and the end.
Let us again summarize the properties of the infix function that they just have one parameter and all
infix function or extension function but all extension function cannot be the infix function.
Right.
So let us know in the video.
And guys you guys in the next video there's a shooting at the hard signing off and have a good day.
Thank you.