mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
algorithm, operation 全面修正
This commit is contained in:
parent
21f5d5191a
commit
5e67195030
244 changed files with 4764 additions and 831 deletions
|
@ -31,8 +31,8 @@ namespace sprout {
|
|||
typedef sprout::detail::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef sprout::detail::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
public:
|
||||
static constexpr size_type static_size = N;
|
||||
static constexpr size_type fixed_size = static_size;
|
||||
SPROUT_STATIC_CONSTEXPR size_type static_size = N;
|
||||
SPROUT_STATIC_CONSTEXPR size_type fixed_size = static_size;
|
||||
public:
|
||||
T elems[N ? N : 1];
|
||||
public:
|
||||
|
@ -104,13 +104,13 @@ namespace sprout {
|
|||
return elems[0];
|
||||
}
|
||||
SPROUT_CONSTEXPR const_reference front() const {
|
||||
return elems[size() - 1];
|
||||
return elems[0];
|
||||
}
|
||||
reference back() {
|
||||
return elems[size() - 1];
|
||||
}
|
||||
SPROUT_CONSTEXPR const_reference back() const {
|
||||
return elems[0];
|
||||
return elems[size() - 1];
|
||||
}
|
||||
pointer data() SPROUT_NOEXCEPT {
|
||||
return elems;
|
||||
|
@ -191,8 +191,8 @@ namespace sprout {
|
|||
// make_array
|
||||
//
|
||||
template<typename T, typename... Tail>
|
||||
SPROUT_CONSTEXPR inline sprout::array<T, 1 + sizeof...(Tail)> make_array(T&& head, Tail&&... tail) {
|
||||
return sprout::array<T, 1 + sizeof...(Tail)>{std::forward<T>(head), std::forward<T>(tail)...};
|
||||
SPROUT_CONSTEXPR inline sprout::array<T, 1 + sizeof...(Tail)> make_array(T const& head, Tail const&... tail) {
|
||||
return sprout::array<T, 1 + sizeof...(Tail)>{head, tail...};
|
||||
}
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR inline sprout::array<T, 0> make_array() {
|
||||
|
@ -226,7 +226,7 @@ namespace std {
|
|||
struct tuple_size<sprout::array<T, N> > {
|
||||
public:
|
||||
typedef std::integral_constant<std::size_t, N> type;
|
||||
static constexpr std::size_t value = type::value;
|
||||
SPROUT_STATIC_CONSTEXPR std::size_t value = type::value;
|
||||
};
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue