靜態字符我想要做這樣的事情: template<typename T>
const char * toStr(T num)
{
thread_local static char rc[someval*sizeof(T)] str = "0x000...\0"; // num of zeros depends on size of T
// do something with
比方說,我有這樣定義的類FunctionWrapper: struct FunctionWrapper
{
FunctionWrapper(std::function<void()> f);
// ... plus other members irrelevant to the question
};
我想,以防止隱式轉換從std::function<void()>到