- Severity Code Description Project File Line Suppression State
Error C2677 binary ‘[’: no global operator found which takes type ‘T’
(or there is no acceptable conversion) - Severity Code Description Project File Line Suppression State
Error C2676 binary ‘++’: ‘T’ does not define this operator or a
conversion to a type acceptable to the predefined operator
模板T的类型与操作的类型不匹配导致
出现此错误的原因是类成员定义了一个T head;
随后又执行了array[head++]
的操作,而此刻的模板类型为string