Windowsでnghttp2、opensourceをコンパイルしようとしています。私は既にLinuxで同じことをうまくコンパイルしました。Visual Studioのstd :: beginとend :: endイテレータ
次のコードからコンパイルエラーが発生しています。 *
template <size_t N> struct Memchunk {
public:
Memchunk(Memchunk *next_chunk)
: pos(std::begin(buf)), last(pos), knext(next_chunk), next(nullptr) {}
size_t len() const { return last - pos; }
size_t left() const { return std::end(buf) - (const size_t) last; }
void reset() { pos = last = std::begin(buf); }
std::array<uint8_t, N> buf;
uint8_t *pos, *last;
Memchunk *knext;
Memchunk *next;
static const size_t size = N;
};
*
私は、次のエラーを取得しています。
error C2440: 'return': cannot convert from'std::_Array_const_iterator<_Ty,16384>' to 'std::size_t'
私はLinuxで前述のエラーに直面しませんでした。私はVisual Studioに固有のものを見逃していますか?
非常に悪いC++コードのように見えます。 – Stargateur
gccはどちらも気に入らないhttp://ideone.com/SJNXbJ。どのコンパイラがこれを受け入れますか?エラーは私には意味がある。 – Persixty
どうして 'std :: array :: iterator pos、last;'?理解できません。 –
ZDF