Perfectly explained. Please start an advanced c++ series
@ergeorgiev
8 жыл бұрын
This tutorial is very professional and well done. Thank you! I wish I had teachers as good as you, sadly i haven't had the luck until now.
@bluehornet6752
7 жыл бұрын
Indeed--and I have no idea why 6 people (at the time I wrote this) gave this video a thumbs-down. Maybe they should be Python programmers?!?
@jnyfah
3 жыл бұрын
@@bluehornet6752 😂😂😂
@kflo411
9 жыл бұрын
If only all programming concept videos were this clear-cut, smart, thorough, and efficient... Exemplary teaching, with great examples and explanations(!)
@MagnoVJ10
7 жыл бұрын
Man, C++ is really a complex language I thought I knew a lot about it but then I enconter things I never seen before like functors and lambda expressions. Thanks for the tutorial it was really very clear and comprehensible.
@learnfromatharv7121
7 жыл бұрын
I couldnt find any better explanation than this for lambda anywhere. Thanks a lot.
@moobanposrisuk
10 жыл бұрын
Excellent video Bradley, thanks so much!
@GiuseppeAvella
7 жыл бұрын
Best Lambda explanation found till now. Please Bradley, add more tutorials.
@fredlawton7561
8 жыл бұрын
Very clear and concise! I don't normally comment on KZitem videos, but I logged into my account to thank you for the great video.
@Abdullah-mg5zl
9 жыл бұрын
Thanks! That was extremely helpful. Great examples :) So to summarize: -lambda expressions are a shortcut for creating functor objects -the syntax is [capture local variables] (input parameters) -> return type { function body;} -if you to use local variables you must capture them -you can capture either by value (=) or by reference (&) -you would obviously capture by reference if you want to actually modify that variable
@bluehornet6752
7 жыл бұрын
-you can capture either by value (=) or (name), or by reference (&)
@DehimVerveen
6 жыл бұрын
@Tom B, If you just type in the name of the variable you want to capture, it's a capture by value. If you add an & before the name of the variable, it's a capture by reference.
@2aprogressive626
Жыл бұрын
Good summary!
@MrAman47
3 жыл бұрын
Just started learning C++, great video!
@tmstore3472
6 жыл бұрын
Very simple to learn, thanks
@DanielPolanco
10 жыл бұрын
Nice simple introduction to Lambdas. Thanks for posting! I'm really glad you edited out the places where you were typing stuff that wasn't too important.
@yanivgardi9028
4 жыл бұрын
Very clear and helpful tutorial! thanks
@deepak55793
7 жыл бұрын
Thank you so much. I really appreciate the examples and coverage of the topic. Thank you again.
@jugglerfox
6 жыл бұрын
marvelous tutorial! You explained it very clearly and eloquently good sir
@RajeshKrishnan1
8 жыл бұрын
Awesome explanation! Thanks.
@bradleyneedham1666
11 жыл бұрын
No auto cannot be used as the trailing return type. You can however use decltype. []()->decltype(f()) { return f();} However, you do not need to specify a return type in the above case since it can be easily deduced.
@raghuramchary9119
4 жыл бұрын
What an awesome video. Thank you 👍
@MrHiasbaum
6 жыл бұрын
Pretty straight forward Well done dude
@sieberoets781
4 жыл бұрын
Fantastic explanation sir thank you very much!
@user-xl1gq2zg5s
8 жыл бұрын
your explanations are great!! thank's!!
@valizeth4073
5 жыл бұрын
To sum it up shortly. A lambda is a function pointer, that can be defined locally (inline) inside another scope.
@firelordkushroll
10 жыл бұрын
absolutely brilliant; great video!
@satyasidhu1
8 жыл бұрын
Amazing tutorial. Awesome job. Thank you.
@ErfanHossainShoaib
9 жыл бұрын
simple but awesome...
@guywald1
8 жыл бұрын
Thank you. Very informative!
@tnagata2005
11 жыл бұрын
Thank you for clear explanation!
@btelles
8 жыл бұрын
Very well said! You've got a new fan. :) Hope you get back into creating these videos. Very helpful. :)
@Kakaobutter
11 жыл бұрын
very well explained, thank you
@account4watching
11 жыл бұрын
excellent video
@sebastiankupis4448
7 жыл бұрын
Good tutorial! Helps me a lot!
@638naveen
8 жыл бұрын
very good explanation
@MrDillonowns
10 жыл бұрын
This is amazing. Thank you kind stranger.
@Altometer76
8 жыл бұрын
Thanks mate, you made my day ! Thank you a lot.
@bluehornet6752
7 жыл бұрын
An amazingly-helpful demonstration of both functors and lambda functions! Outstanding sir!
@MarazLP
5 жыл бұрын
Nice examples, perfect explanation and very thourogh. Awesome video! Thank you!
@fisslewine1222
8 жыл бұрын
really good enjoy this
@WaffleBoy13100
10 жыл бұрын
Well done
@2aprogressive626
Жыл бұрын
Excellent!
@murlidharpandey1163
8 жыл бұрын
very good tutorial
@MyFightMoney
9 жыл бұрын
This was soooooo amazingly useful!!!! Brilliant stuff.
@iamravishank
5 жыл бұрын
best video on lambda
@IchimMarian2011
10 жыл бұрын
Dude,i really enjoyed your video.Amazing stuff !
@malharjajoo7393
6 жыл бұрын
Good analogy about capturing and functor constructors.
@harish1508
5 жыл бұрын
At 7:14 How does the nameless lambda within count_if get input argument, without specifying what the x value is?? Or without being called, how does the vector values passed into lambda ?
@stasszczesniak
10 жыл бұрын
More than perfect.
@Sarthakz99
8 жыл бұрын
awesome !!
@markkazmenko
9 жыл бұрын
11:40 it's because operator () in lambda is a constant function
@antiHUMANDesigns
8 жыл бұрын
It would seem to me that a better way to check is something "isEven(int x)" would be "return !(x & 1);". Modulus calculation is very expensive, while "bit-wise AND" is cheap. Also, of course, "isOdd(int x)" would simply be "return x & 1;".
@edlugoa
7 жыл бұрын
Perfect!!!!
@ghostxop2101
10 жыл бұрын
2:43 is where i subscribe. Become a professor please.
@NitinPatilEmbedded
6 жыл бұрын
That's really helped. Thanks
@maxdebest
7 жыл бұрын
Thank you! Well explained
@ershashi
7 жыл бұрын
Awsome tutorial :-)
@moshehalevihalemo1604
6 жыл бұрын
Thank you for the helpful tutorial
@BipinOli90
7 жыл бұрын
NIcely done!
@nickhuynh6321
5 жыл бұрын
Thanks!!! I also learned what functors are ;-)
@verber001
7 жыл бұрын
I tried this with VS2015 and actually ended up using the following which ends up with less code...do you happen to know if the for_each in C++ 14 takes lambda expressions? I tried to force it but got no where. std::vector col; col.push_back(1); col.push_back(2); col.push_back(3); col.push_back(4); col.push_back(5); int sum = 0; for each (int x in col) { sum += x; } std::cout
@codingandmathvideos
10 жыл бұрын
wow! Absolutely great tutorial. Thank you.
@kim15742
9 жыл бұрын
I didn't even know you could overload operator() ...
@stylepetrov
11 жыл бұрын
fantastic, tnx for sharing :)
@36goldfinger
10 жыл бұрын
u are awesome :)
@jnyfah
3 жыл бұрын
Thank youu 😊
@aru05001
9 жыл бұрын
Why did you need to capture the variable with the multiple functor? couldnt u use multi instead of m_multi and save an assignment operator? When you capture a variable, is it captured as const?
@Cheenoh2104
7 жыл бұрын
Brilliant!
@rafaelocariz1384
5 жыл бұрын
Hello Bradley! I'm facing some problems with lambda, I need to declare a function who execute something different depending on the input, on the other programs of the project this function is being called like this: int_op["add"](3, 5), but Lamba isn't supposed to be named and they are calling that way, how can I implement this int_op function?? please, help
@sr5726
9 жыл бұрын
Thanks ! Excellent video, One question, if "return" keyword is not specified, how does lambda work eg. a bad exmaple to understand return type of lamba vector v{ 10, 20, 30, 40 ,50 , 100}; sum = 0; noOfElements = 0; bool bHas= false; for_each(v.begin(), v.end(), [&](int x) { sum += x; noOfElements++; bHas= true; }); cout
@MauritsBuijs
9 жыл бұрын
He said it in the video...
@nickmead7041
9 жыл бұрын
***** the default return type is void, so because your [] has no return type its assumed void. But as he says in the video, for multiple lines of code nothing as assumed and you have to specify, watch the video for how to do that.
@waroracle2692
9 жыл бұрын
awesome video, but next time try to use deesser on your voice, those 'ss' are pretty harsh
@cisco4766
6 жыл бұрын
man nit picks every little flaw. Atleast his tutorials are informative dude, dont act so ungrateful
@yousufazad6914
8 жыл бұрын
awesome tutorial (Y)
@HighRollersLounge
8 жыл бұрын
Thank you!
@JadtheProdigy
7 жыл бұрын
at 9:17 , you are passing 'sum' to the constructor of 'sumUp'. 'sum' is declared as an int, but 'sumUp' constructor takes an int reference, how can this occur?
@80amnesia
5 жыл бұрын
thanks
@madhurchauhan1288
6 жыл бұрын
600th like!
@vimalk78
10 жыл бұрын
which IDE you are using? and which compiler?
@bradleyneedham1666
10 жыл бұрын
Xcode (Apple's IDE). Complier clang 5.0
@vimalk78
10 жыл бұрын
thx
@bradleyneedham1666
11 жыл бұрын
The above should not and does not compile on Clang.
@MRGCProductions20996
7 жыл бұрын
what is a functor?
@PROfesioZNALAC
7 жыл бұрын
A class(or a struct) which has an operator()([some parameters]). It's important to notice that the second pair of parentheses is predicted to formal arguments. These lambda functions provide only(in this case) another way to write the same thing in less number of code. Functionality is the same. Also, lambda functions are available since C++11 versions of C++ compilers.
@bluehornet6752
7 жыл бұрын
It's a function "object." Hence the need to create a class. Also, you need to overload operator(), which is what he expertly showed how to do. This video was really about as good as it gets--for both illustrating how to use both functors and lambda functions. Nearly 15 minutes of pure C++ gold...
Пікірлер: 93