How to differentiate (when overloading) between prefix and postfix forms of operator++? (C++)

前端 未结 4 1577
眼角桃花
眼角桃花 2020-12-03 16:05

Because I\'ve overloaded the operator++ for an iterator class

template
typename list::iterator& list::it         


        
4条回答
  •  心在旅途
    2020-12-03 16:25

    Postfix has an int argument in the signature.

    Class& operator++();    //Prefix 
    Class  operator++(int); //Postfix 
    

提交回复
热议问题