Boost logo

Boost Users :

Subject: Re: [Boost-users] A forward iterator need not be default-constructible
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2011-09-30 10:21:53


2011/9/30 Krzysztof Żelechowski <giecrilj_at_[hidden]>

> I doubt there may be a sequence of length 0 at NULL. How would you
> allocate
> such a sequence?

I believe this code is valid:

#include <vector>

int main() {
  const int *begin = 0, *end = 0;
  std::vector<int> v(begin, end);
}

NULL pointer is a valid pass-the-end iterator here.

Roman Perepelitsa.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net