我认为他们被称为算子?(有一阵子了)
基本上,我想在变量中存储指向函数的指针,因此我可以从命令行指定我想要使用的函数.
所有函数都返回并采用相同的值.
unsigned int func_1 (unsigned int var1)
unsigned int func_2 (unsigned int var1)
function_pointer = either of the above?
所以我可以通过以下方式调用它: function_pointer(my_variable)?
编辑:根据@ larsmans的建议,我得到了这个:Config.h:
class Config
{
public:
    unsigned static int (*current_hash_function)(unsigned int);
};
Config.cpp:
#include "Config.h"
#include "hashes.h"
unsigned static int (*current_hash_function)(unsigned int) = kennys_hash_16;
hashes.h:
unsigned int kennys_hash(unsigned int out);
unsigned int kennys_hash_16(unsigned int out);
hashes.cpp:
just implements the functions in the header
main.cpp中:
#include "Config.h"
#include "hashes.h"
// in test_network:
    unsigned int hashed = Config::current_hash_function(output_binary);
//in …