Skip to content

Commit

Permalink
update fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Feb 28, 2024
1 parent 3307855 commit fe3feb2
Show file tree
Hide file tree
Showing 14 changed files with 4,796 additions and 4,273 deletions.
13 changes: 7 additions & 6 deletions 3rd/fmt/fmt/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <memory> // std::unique_ptr
#include <vector>

#include "core.h"
#include "format.h" // std_string_view

FMT_BEGIN_NAMESPACE

Expand All @@ -22,8 +22,9 @@ template <typename T> struct is_reference_wrapper : std::false_type {};
template <typename T>
struct is_reference_wrapper<std::reference_wrapper<T>> : std::true_type {};

template <typename T> const T& unwrap(const T& v) { return v; }
template <typename T> const T& unwrap(const std::reference_wrapper<T>& v) {
template <typename T> auto unwrap(const T& v) -> const T& { return v; }
template <typename T>
auto unwrap(const std::reference_wrapper<T>& v) -> const T& {
return static_cast<const T&>(v);
}

Expand All @@ -50,7 +51,7 @@ class dynamic_arg_list {
std::unique_ptr<node<>> head_;

public:
template <typename T, typename Arg> const T& push(const Arg& arg) {
template <typename T, typename Arg> auto push(const Arg& arg) -> const T& {
auto new_node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
auto& value = new_node->value;
new_node->next = std::move(head_);
Expand Down Expand Up @@ -110,14 +111,14 @@ class dynamic_format_arg_store

friend class basic_format_args<Context>;

unsigned long long get_types() const {
auto get_types() const -> unsigned long long {
return detail::is_unpacked_bit | data_.size() |
(named_info_.empty()
? 0ULL
: static_cast<unsigned long long>(detail::has_named_args_bit));
}

const basic_format_arg<Context>* data() const {
auto data() const -> const basic_format_arg<Context>* {
return named_info_.empty() ? data_.data() : data_.data() + 1;
}

Expand Down
Loading

0 comments on commit fe3feb2

Please sign in to comment.