error: void value not ignored as it ought to be

后端 未结 3 2103
孤城傲影
孤城傲影 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:21

    std::vector::pop_back() returns void. You attempt to return it as an int. This is not allowed.

提交回复
热议问题