我正在这样做:
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
const auto foo = cbegin(arr);
const typename iterator_traits<decltype(foo)>::value_type bar = 1;
我本来希望bar
有 type int
。但相反,我收到了一个错误:
错误 C2039:
value_type
: 不是std::iterator_traits<_Ty *const >
这是const
我需要剥离它还是什么的问题?