我如何在运行时定义函数内部的返回类型?我有一个成员char* m_data; 我想在不同的情况下将 m_data 转换为不同的类型。
?type? getData() const
{
switch(this->p_header->WAVE_F.bitsPerSample)
{
case 8:
{
// return type const char *
break;
}
case 16:
{
// return type const short *
break;
}
case 32:
{
// return type const int *
break;
}
}
}