fork download
#include <list>

int main()
{
    std::list<int> list ;
    list.push_back(1) ;
    list.push_back(2) ;

    auto it = list.begin() ;
    ++it ;
    unsigned position = it - list.begin() ;
}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:11:41: error: no match for 'operator-' in 'it - list.std::list<_Tp, _Alloc>::begin [with _Tp = int, _Alloc = std::allocator<int>, std::list<_Tp, _Alloc>::iterator = std::_List_iterator<int>]()'
stdout

Standard output is empty