Boost logo

Boost :

Subject: Re: [boost] [smart-ptr][containers] type of the operator[] index
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-12-04 12:02:53

On Sun, Dec 4, 2011 at 5:46 PM, Vicente J. Botet Escriba
<vicente.botet_at_[hidden]> wrote:
> which is the correct type used as index of operator[]. scoped_array uses
> std::ptrdiff_t. Others containers use std::size_t.

If [-1] might be valid, ptrdiff_t makes sense. Otherwise, I'd opt for size_t.

Boost list run by bdawes at, gregod at, cpdaniel at, john at