samedi 25 mai 2019

Which of the following best describes a lambda function?

C++11 introduced a new programming concept: the lambda function. Which of the following best describes a lambda function?

(a) A short function where the definition and declaration are combined within the class declaration.

(b) A pointer-like reference to a function defined in the global namespace.

(c) A function with no name, which can be passed around like data.

(d) A function which provides guarantees that it will not modify the contents of the object it belongs to.

(e) A function which provides generic functionality, regardless of the type of the input data.

I don't think it's c) or d) and I'm confused about b). I understand the basics about a lambda function but I'm confused which is the right answer from the ones above.

Aucun commentaire:

Enregistrer un commentaire