i've just been reading some various documentation and forums and what not for interesting ways of doing things, and i've stumbled upon a syntax i've straight up never seen before. can someone tell me what the heck this means?
std::vector <base *(*)()> vectorArray;
i've been using vectors in many of my programs, but i've never seen something like this done before. apparently it allows you store a function call in it, and then, based on whatever iterator that function call is at, you just go:
vectorArray[0] ();
and it calls whatever function you put there. This seems like an excellent way to call constructors for various derived classes, so you can just make an iterator synonymous with a certain class, shoot use a map even :P, but use it to call the constructor for a derived class and store it an a pointer to the base class, but the syntax is so foreign to me, i'm tentative as to whether it's safe to use it or not. i'd really like to :P so, in summary, my question is, what is this doing, how is it doing it, is this operation specific to vectors or general to c and c++ arrays, and is it safe to use it?