Compare commits
7 Commits
86930fd8b0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b7159c3606 | |||
| 2be63fda5a | |||
| 036b17fca9 | |||
| 045363c733 | |||
| 4d05a9a8fa | |||
| ee1153c393 | |||
| b29695e148 |
@@ -66,16 +66,13 @@ constexpr inline void format_arg(char* dest, const char* arg) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// End of recursion
|
|
||||||
template <auto ast>
|
|
||||||
constexpr inline void format_args(char*) {
|
|
||||||
}
|
|
||||||
|
|
||||||
template <auto fmt_data_array, typename first_arg_t, typename... args_t>
|
template <auto fmt_data_array, typename first_arg_t, typename... args_t>
|
||||||
constexpr inline void format_args(char* dest, first_arg_t first_arg,
|
constexpr inline void format_args(char* dest, first_arg_t first_arg,
|
||||||
args_t... args) {
|
args_t... args) {
|
||||||
format_arg<fmt_data_array[0]>(dest + fmt_data_array[0].position, first_arg);
|
format_arg<fmt_data_array[0]>(dest + fmt_data_array[0].position, first_arg);
|
||||||
format_args<drop_first(fmt_data_array)>(dest, args...);
|
|
||||||
|
if constexpr(fmt_data_array.size() > 1)
|
||||||
|
format_args<drop_first(fmt_data_array)>(dest, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,8 +187,11 @@ concept floating_point = is_floating_point_v<type_t>;
|
|||||||
|
|
||||||
|
|
||||||
template <typename input_t, typename output_t>
|
template <typename input_t, typename output_t>
|
||||||
constexpr inline void copy(input_t* start, input_t* end, output_t* dest_start) {
|
constexpr inline void copy(const input_t* start, const input_t* end,
|
||||||
memcpy(start, dest_start, end - start);
|
output_t* dest_start) {
|
||||||
|
auto temp = start;
|
||||||
|
while (temp != end)
|
||||||
|
*(dest_start++) = *(temp++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -234,14 +237,11 @@ public:
|
|||||||
static_assert(sizeof...(args) == t_size, "Invalid number of arguments");
|
static_assert(sizeof...(args) == t_size, "Invalid number of arguments");
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr array() noexcept = default;
|
constexpr array() noexcept = default;
|
||||||
|
constexpr array(const array&) = default;
|
||||||
constexpr array(array&) = default;
|
constexpr array(array&&) = default;
|
||||||
|
|
||||||
constexpr array(array&&) = default;
|
|
||||||
|
|
||||||
constexpr array& operator=(array& other) = default;
|
|
||||||
|
|
||||||
|
constexpr array& operator=(const array& other) = default;
|
||||||
constexpr array& operator=(array&& other) = default;
|
constexpr array& operator=(array&& other) = default;
|
||||||
|
|
||||||
constexpr void swap(array<data_t, t_size>& other) noexcept {
|
constexpr void swap(array<data_t, t_size>& other) noexcept {
|
||||||
@@ -251,6 +251,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr std::size_t size() const noexcept {
|
||||||
|
return t_size;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr data_t& operator[](std::size_t index) noexcept {
|
constexpr data_t& operator[](std::size_t index) noexcept {
|
||||||
return m_data[index];
|
return m_data[index];
|
||||||
@@ -272,6 +275,14 @@ public:
|
|||||||
return (&(m_data[t_size - 1]) + 1);
|
return (&(m_data[t_size - 1]) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr const_iterator begin() const noexcept {
|
||||||
|
return &(m_data[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr const_iterator end() const noexcept {
|
||||||
|
return (&(m_data[t_size - 1]) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
constexpr const_iterator cbegin() const noexcept {
|
constexpr const_iterator cbegin() const noexcept {
|
||||||
return &(m_data[0]);
|
return &(m_data[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user