Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some noexcept #2684

Merged
merged 1 commit into from
Jan 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,19 @@ template <typename Char> class basic_string_view {
size_(s.size()) {}

/** Returns a pointer to the string data. */
constexpr auto data() const -> const Char* { return data_; }
constexpr auto data() const FMT_NOEXCEPT -> const Char* { return data_; }

/** Returns the string size. */
constexpr auto size() const -> size_t { return size_; }
constexpr auto size() const FMT_NOEXCEPT -> size_t { return size_; }

constexpr auto begin() const -> iterator { return data_; }
constexpr auto end() const -> iterator { return data_ + size_; }
constexpr auto begin() const FMT_NOEXCEPT -> iterator { return data_; }
constexpr auto end() const FMT_NOEXCEPT -> iterator { return data_ + size_; }

constexpr auto operator[](size_t pos) const -> const Char& {
constexpr auto operator[](size_t pos) const FMT_NOEXCEPT -> const Char& {
return data_[pos];
}

FMT_CONSTEXPR void remove_prefix(size_t n) {
FMT_CONSTEXPR void remove_prefix(size_t n) FMT_NOEXCEPT {
data_ += n;
size_ -= n;
}
Expand Down Expand Up @@ -1496,14 +1496,14 @@ class appender : public std::back_insert_iterator<detail::buffer<char>> {

public:
using std::back_insert_iterator<detail::buffer<char>>::back_insert_iterator;
appender(base it) : base(it) {}
appender(base it) FMT_NOEXCEPT : base(it) {}
using _Unchecked_type = appender; // Mark iterator as checked.

auto operator++() -> appender& {
auto operator++() FMT_NOEXCEPT -> appender& {
return *this;
}

auto operator++(int) -> appender {
auto operator++(int) FMT_NOEXCEPT -> appender {
return *this;
}
};
Expand Down