error: void value not ignored as it ought to be

后端 未结 3 2104
孤城傲影
孤城傲影 2021-02-18 20:02
template  Z myTemplate  :: popFromVector ()
{
    if (myVector.empty () == false)
        return myVector.pop_back ();

    return 0;
}

int m         


        
3条回答
  •  既然无缘
    2021-02-18 20:29

    It's the pop_back(). It has a void return type. You have to use back() to get the actual value. This is to avoid unnecessary copies.

提交回复
热议问题