25 #ifndef XAPIAN_INCLUDED_SMALLVECTOR_H
26 #define XAPIAN_INCLUDED_SMALLVECTOR_H
71 return T(
static_cast<typename T::Internal*
>(*
ptr));
75 return T(
static_cast<typename T::Internal*
>(
ptr[idx]));
99 static_cast<void *
const *
>(
p[0]) :
105 static_cast<void *
const *
>(
p[1]) :
110 return c >
sizeof(
p) /
sizeof(*
p) ?
111 static_cast<void**
>(
p[1]) -
static_cast<void**
>(
p[0]) :
c;
115 return c >
sizeof(
p) /
sizeof(*
p) ?
c :
sizeof(
p) /
sizeof(*
p);
119 return c >
sizeof(
p) /
sizeof(*
p) ?
p[0] ==
p[1] :
c == 0;
124 if ((*i).internal.get() && --(*i).internal->_refs == 0)
125 delete (*i).internal.get();
127 if (
c >
sizeof(
p) /
sizeof(*p))
128 delete []
static_cast<typename T::Internal**
>(
p[0]);
134 if (n >
sizeof(
p) /
sizeof(*
p) && n >
c) {
147 if (elt.internal.get())
148 ++elt.internal->_refs;
149 if (
c >=
sizeof(
p) /
sizeof(*
p)) {
150 void ** e =
static_cast<void **
>(
p[1]);
151 *e++ =
static_cast<void*
>(elt.internal.get());
152 p[1] =
static_cast<void*
>(e);
154 p[
c++] = elt.internal.get();
bool operator==(const const_iterator &o) const
const_iterator operator+(int n)
const_iterator(void *const *ptr_)
const_iterator operator++(int)
T operator[](size_type idx) const
bool operator!=(const const_iterator &o) const
const_iterator & operator++()
void do_reserve(std::size_t n)
Vector of Xapian PIMPL objects.
T operator[](size_type idx) const
const_iterator begin() const
const_iterator end() const
void push_back(const T &elt)
size_type capacity() const
void reserve(size_type n)
The Xapian namespace contains public interfaces for the Xapian library.