}
}
else {
- for (pointer si = p_data; si != p_data + size_; ++si) {
+ for (; si != p_data + size_; ++si) {
alloc_.construct (di, *si);
++di;
}
return data_;
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return data_ + size_;
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
BOOST_UBLAS_INLINE
iterator begin () {
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
+ BOOST_UBLAS_INLINE
reverse_iterator rbegin () {
return reverse_iterator (end ());
}
// Serialization
template<class Archive>
- void serialize(Archive & ar, const unsigned int version)
+ void serialize(Archive & ar, const unsigned int /*version*/)
{
serialization::collection_size_type s(size_);
ar & serialization::make_nvp("size",s);
return data_;
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return data_ + size_;
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
BOOST_UBLAS_INLINE
iterator begin () {
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
+ BOOST_UBLAS_INLINE
reverse_iterator rbegin () {
return reverse_iterator (end ());
}
friend class boost::serialization::access;
template<class Archive>
- void serialize(Archive & ar, const unsigned int version)
+ void serialize(Archive & ar, const unsigned int /*version*/)
{
serialization::collection_size_type s(size_);
ar & serialization::make_nvp("size", s);
private:
size_type size_;
+// MSVC does not like arrays of size 0 in base classes. Hence, this conditionally changes the size to 1
+#ifdef _MSC_VER
+ BOOST_UBLAS_BOUNDED_ARRAY_ALIGN value_type data_ [(N>0)?N:1];
+#else
BOOST_UBLAS_BOUNDED_ARRAY_ALIGN value_type data_ [N];
+#endif
};
return data_;
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return data_ + size_;
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
typedef pointer iterator;
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
+ BOOST_UBLAS_INLINE
reverse_iterator rbegin () {
return reverse_iterator (end ());
}
return data_.get ();
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return data_.get () + size_;
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
typedef pointer iterator;
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
+ BOOST_UBLAS_INLINE
reverse_iterator rbegin () {
return reverse_iterator (end ());
}
return const_iterator (*this, start_);
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return const_iterator (*this, start_ + size_);
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
// Reverse iterator
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
+ BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
BOOST_UBLAS_INLINE
basic_range preprocess (size_type size) const {
return const_iterator (*this, 0);
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return const_iterator (*this, size_);
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
// Reverse iterator
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
+ BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
BOOST_UBLAS_INLINE
basic_slice preprocess (size_type size) const {
return const_iterator (*this, 0);
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end () const {
return const_iterator (*this, size_);
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
// Reverse iterator
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
return const_reverse_iterator (end ());
}
BOOST_UBLAS_INLINE
+ const_reverse_iterator crbegin () const {
+ return rbegin ();
+ }
+ BOOST_UBLAS_INLINE
const_reverse_iterator rend () const {
return const_reverse_iterator (begin ());
}
+ BOOST_UBLAS_INLINE
+ const_reverse_iterator crend () const {
+ return rend ();
+ }
BOOST_UBLAS_INLINE
indirect_array preprocess (size_type size) const {
template <class V>
class index_pair :
- private boost::noncopyable,
public container_reference<V> {
typedef index_pair<V> self_type;
rhs = *this;
*this = tmp;
}
+
BOOST_UBLAS_INLINE
friend void swap(self_type& lhs, self_type& rhs) {
lhs.swap(rhs);
}
+ friend void swap(self_type lhs, self_type rhs) { // For gcc 4.8 and c++11
+ lhs.swap(rhs);
+ }
+
+
BOOST_UBLAS_INLINE
bool equal(const self_type& rhs) const {
return (v1_ == rhs.v1_);
return const_iterator( (*this), 0);
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end() const {
return const_iterator( (*this), size());
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
// unnecessary function:
BOOST_UBLAS_INLINE
template <class M>
class index_triple :
- private boost::noncopyable,
public container_reference<M> {
typedef index_triple<M> self_type;
rhs = *this;
*this = tmp;
}
+
BOOST_UBLAS_INLINE
friend void swap(self_type& lhs, self_type& rhs) {
lhs.swap(rhs);
}
+ friend void swap(self_type lhs, self_type rhs) { // For gcc 4.8 and c++11
+ lhs.swap(rhs);
+ }
+
BOOST_UBLAS_INLINE
bool equal(const self_type& rhs) const {
return ((v1_ == rhs.v1_) && (v2_ == rhs.v2_));
return const_iterator( (*this), 0);
}
BOOST_UBLAS_INLINE
+ const_iterator cbegin () const {
+ return begin ();
+ }
+ BOOST_UBLAS_INLINE
const_iterator end() const {
return const_iterator( (*this), size());
}
+ BOOST_UBLAS_INLINE
+ const_iterator cend () const {
+ return end ();
+ }
// unnecessary function:
BOOST_UBLAS_INLINE