14#define CONSERVATIVE_PLAYER_ACCESS
18 template <
typename T,
size_t Capacity>
23 typedef typename std::remove_cv<T>::type
T_simple;
36#ifndef CONSERVATIVE_PLAYER_ACCESS
38 return *((T*)((
char *)&elements[0] +
39 (p & ((
char *)&elements[1]-(
char *)&elements[0]))));
46#ifndef CONSERVATIVE_PLAYER_ACCESS
47 return *((T*)((
char *)&elements[0] +
48 (p & ((
char *)&elements[1]-(
char *)&elements[0]))));
63 typedef typename std::array<T,Capacity>::iterator
iterator;
71 template <class T2, class = typename std::enable_if<!std::is_convertible<T2,T_simple>::value>::type>
72 void fill(
const T2& value=T2()) {
76 static size_t size() {
return Capacity; }
94 template <
typename T,
size_t Capacity1,
size_t Capacity2>
97 template <
typename T,
size_t Capacity1,
size_t Capacity2,
size_t Capacity3>
102 template <
typename T>
107#if ! (defined NDEBUG && defined MINIMAL)
113#if ! (defined NDEBUG && defined MINIMAL)
135 template <
typename T,
size_t Capacity>
167 template <
class RangeIterator>
205 assert(
size() < Capacity);
209 template <
class RangeIterator>
210 void push_back(
const RangeIterator& first,
const RangeIterator& last);
222 while (
size() < new_length)
224 if (new_length <
size()) {
255 const T&
back()
const {
return *(
end() - 1); }
258 return std::find(first, last, e) != last;
267 template <
typename T,
size_t C>
inline
272 template <
typename T,
size_t C>
inline
275 return std::lexicographical_compare(l.
begin(), l.
end(), r.
begin(), r.
end());
277 using detail::FixedCapacityVectorPushBack;
280template <
typename T,
size_t Capacity>
281template <
class RangeIterator>
285 std::uninitialized_copy(first, last, insert_point);
287 assert(size() <= Capacity);
void fill(const T_simple &value=T_simple())
std::array< T, Capacity >::const_iterator const_iterator
std::array< T, Capacity > array
std::array< T, Capacity >::iterator iterator
const_iterator cbegin() const
void fill(const T2 &value=T2())
const_iterator cend() const
bool operator==(const CArray &other) const
const_iterator end() const
std::remove_cv< T >::type T_simple
const_iterator begin() const
const array_t & elements() const
bool isMember(const T &e) const
const_iterator begin() const
FixedCapacityVector(size_t size)
void push_back(const T &e)
array_t::value_type value_type
const_iterator end() const
FixedCapacityVector & operator=(FixedCapacityVector const &rhs)
array_t::iterator iterator
FixedCapacityVector(FixedCapacityVector const &rhs)
void resize(size_t new_length)
bool isMember(const T &e, const_iterator first, const_iterator last) const
void push_back(const RangeIterator &first, const RangeIterator &last)
array_t::const_iterator const_iterator
detail::FixedCapacityVectorPushBack< T > pushBackHelper()
FixedCapacityVector(const RangeIterator &first, const RangeIterator &last)
CArray< int64_t,(sizeof(T[Capacity])+sizeof(int64_t) -1)/sizeof(int64_t)> relements
static const unsigned int MaxUniqMoves
一局面辺りの合法手の最大値 重複して手を生成することがある場合は,600では不足かもしれない
void sortByPtype()
駒の価値の大きい順に並び替える.
void sortByBasic()
駒の価値の小さい順に並び替える.
void sort()
駒の価値の小さい順に並び替える
FixedCapacityVectorPushBack(T **vPtr_, T *limit_)
void push_back(const T &e)
~FixedCapacityVectorPushBack()
void construct(T1 *ptr, const T2 &value, typename boost::enable_if< detail::BitCopyTraits< T1 > >::type *=0)
constexpr int playerToIndex(Player player)
bool operator<(Offset l, Offset r)
unsigned int ptypeOIndex(PtypeO ptypeo)
const PtypeO PTYPEO_EDGE __attribute__((unused))
@ CheckOrEscapeMaxUniqMoves
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
std::ostream & operator<<(std::ostream &os, Player player)
bool operator==(Square l, Square r)
use raw memory copy instead of placement new not to test a given pointer is null