我的C++头盔有以下几条编码。
private:
std::map<std::string, std::vector<std::vector<unsigned short> > > m_usIRDataPool;
public:
std::vector<std::vector<unsigned short> >& IRChannelData(std::string sChannelName);
在其执行档案中,IRChannelData(
)的定义如下:
std::vector<std::vector<unsigned short> >& MyClass::IRChannelData(std::string sChannelName)
{
std::map<std::string, std::vector<std::vector<unsigned short> > >::iterator it = m_usIRDataPool.find( sChannelName );
if ( it != m_usIRDataPool.end() )
{
return it->second;
}
// return ????; // How can I return?
}
因此,如果在<代码>m_usIRDataPool的地图集装箱内没有发现进入(病媒的探测器),将返回。
warning C4715: MyClass::IRChannelData : not all control paths return a value.