this question seems a little bit silly to me but I can't find any similar question so sorry if it's trivial
let's say we have a struct:
struct C {
static void f(int i) { std::cerr << (i + 15) << "\n"; }
static void f(std::string s) { std::cerr << (s + "15") << "\n"; }
};
now somewhere else:
std::function<void(int)> f1 = C::f; // this does not compile
void (*f2)(std::string s) = C::f; // this compiles just fine
the error I'm getting is
error: conversion from ‘’ to non-scalar type ‘std::function’ requested
is there any way to use std::function in such context? what am I missing?
thanks