Lecture 7 - Lambas & Auto Flashcards
What does the auto keyword do?
It is local type inference, so we don’t have to explicitly write what type the variable is.
When is auto useful?
When we have long type names.
What is a lambda expression?
having anonymous functions (AKA function literals)
What is a lambda expression made of of in C/C++?
captures, parameters and body
What is the capture?
The variables we pass in at creation, could be global variables.
What are the parameters.
The things passed in to function when called.
What is the body?
The actual code of the function.
How are the parameters passed to a lambda function?
By value
How are functions passed into pthreads?
as void * type, this means we need to cast a type before using