20 #ifndef GALOIS_LAZYARRAY_H
21 #define GALOIS_LAZYARRAY_H
27 #include <type_traits>
30 #include "galois/config.h"
40 template <
typename _Tp,
unsigned _Size>
42 typedef typename std::aligned_storage<
43 sizeof(_Tp), std::alignment_of<_Tp>::value>::type CharData;
47 _Tp*
get(
size_t __n) {
return &data_[__n].
get(); }
48 const _Tp*
get(
size_t __n)
const {
return &data_[__n].
get(); }
86 bool empty()
const {
return _Size == 0; }
93 throw std::out_of_range(
"lazyArray::at");
98 throw std::out_of_range(
"lazyArray::at");
112 template <
typename... Args>
114 return new (
get(__n)) _Tp(std::forward<Args>(args)...);
119 return emplace(__n, std::move(val));
126 #endif // GALOIS_LAZYARRAY_H
_Tp value_type
Definition: LazyArray.h:51
pointer data()
Definition: LazyArray.h:107
reference front()
Definition: LazyArray.h:102
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: LazyArray.h:61
pointer construct(size_type __n, _Tp &&val)
Definition: LazyArray.h:118
pointer emplace(size_type __n, Args &&...args)
Definition: LazyArray.h:113
bool empty() const
Definition: LazyArray.h:86
size_type size() const
Definition: LazyArray.h:84
const_reverse_iterator rend() const
Definition: LazyArray.h:74
ptrdiff_t difference_type
Definition: LazyArray.h:53
reference operator[](size_type __n)
Definition: LazyArray.h:89
const_iterator cend() const
Definition: LazyArray.h:79
const_reference front() const
Definition: LazyArray.h:103
reverse_iterator rbegin()
Definition: LazyArray.h:69
void destroy(size_type __n)
Definition: LazyArray.h:122
const value_type * const_pointer
Definition: LazyArray.h:57
const_reverse_iterator crbegin() const
Definition: LazyArray.h:80
const_iterator cbegin() const
Definition: LazyArray.h:78
iterator begin()
Definition: LazyArray.h:64
reference at(size_type __n)
Definition: LazyArray.h:91
const_reference at(size_type __n) const
Definition: LazyArray.h:96
const_reverse_iterator crend() const
Definition: LazyArray.h:81
reference back()
Definition: LazyArray.h:104
pointer construct(size_type __n, const _Tp &val)
Definition: LazyArray.h:117
const_pointer data() const
Definition: LazyArray.h:108
iterator end()
Definition: LazyArray.h:66
value_type & reference
Definition: LazyArray.h:54
This is a container that encapsulates space for a constant size array.
Definition: LazyArray.h:41
const_pointer const_iterator
Definition: LazyArray.h:59
size_type max_size() const
Definition: LazyArray.h:85
value_type * pointer
Definition: LazyArray.h:56
const_iterator begin() const
Definition: LazyArray.h:65
const_reverse_iterator rbegin() const
Definition: LazyArray.h:70
reverse_iterator rend()
Definition: LazyArray.h:73
const value_type & const_reference
Definition: LazyArray.h:55
std::reverse_iterator< iterator > reverse_iterator
Definition: LazyArray.h:60
const_reference operator[](size_type __n) const
Definition: LazyArray.h:90
pointer iterator
Definition: LazyArray.h:58
const_reference back() const
Definition: LazyArray.h:105
size_t size_type
Definition: LazyArray.h:52
const_iterator end() const
Definition: LazyArray.h:67
const_reference get() const
Definition: LazyObject.h:113