[Cs3] functors and function pointers

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Mar 6 15:41:32 EST 2024


CS3 students,

There were two questions on the last lecture.

1. Is it possible to have a function pointers to point to the
   (overloaded) function invocation operator by a functor? Kind of
   like this:

   void (*myFuncPointer)(int) = myFunctor(); 

   The answer is "no", it is not possible.

2. Is it possible to use a function container as a rang in an
   algorithm. I have an answer. I added it to the example we studied in class.
   So, on Thursday, I am going to ask what the last for_each in this
   example do?

   http://www.cs.kent.edu/~mikhail/classes/cs3/Examples/STLAlgorithms/Functors/function.cpp

   Think about it.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list