Skip to content

Commit

Permalink
More noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Dec 10, 2024
1 parent 4c5d403 commit 025529f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/tao/pq/field.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace tao::pq

public:
[[nodiscard]] auto name() const -> std::string;
[[nodiscard]] auto index() const -> std::size_t;
[[nodiscard]] auto index() const noexcept -> std::size_t;

[[nodiscard]] auto is_null() const -> bool;
[[nodiscard]] auto get() const -> const char*;
Expand Down
8 changes: 4 additions & 4 deletions include/tao/pq/row.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ namespace tao::pq
};

public:
[[nodiscard]] auto begin() const -> const_iterator;
[[nodiscard]] auto end() const -> const_iterator;
[[nodiscard]] auto begin() const noexcept -> const_iterator;
[[nodiscard]] auto end() const noexcept -> const_iterator;

[[nodiscard]] auto cbegin() const
[[nodiscard]] auto cbegin() const noexcept
{
return begin();
}

[[nodiscard]] auto cend() const
[[nodiscard]] auto cend() const noexcept
{
return end();
}
Expand Down
8 changes: 4 additions & 4 deletions include/tao/pq/table_row.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ namespace tao::pq
};

public:
[[nodiscard]] auto begin() const -> const_iterator;
[[nodiscard]] auto end() const -> const_iterator;
[[nodiscard]] auto begin() const noexcept -> const_iterator;
[[nodiscard]] auto end() const noexcept -> const_iterator;

[[nodiscard]] auto cbegin() const
[[nodiscard]] auto cbegin() const noexcept
{
return begin();
}

[[nodiscard]] auto cend() const
[[nodiscard]] auto cend() const noexcept
{
return end();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pq/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace tao::pq
return m_row->name( m_column );
}

auto field::index() const -> std::size_t
auto field::index() const noexcept -> std::size_t
{
return m_column - m_row->m_offset;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pq/row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ namespace tao::pq
throw std::out_of_range( std::format( "column not found: {}", static_cast< const char* >( in_name ) ) );
}

auto row::begin() const -> row::const_iterator
auto row::begin() const noexcept -> row::const_iterator
{
return const_iterator( field( *this, m_offset ) );
}

auto row::end() const -> row::const_iterator
auto row::end() const noexcept -> row::const_iterator
{
return const_iterator( field( *this, m_offset + m_columns ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pq/table_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace tao::pq
return { *m_reader, m_offset + offset, in_columns };
}

auto table_row::begin() const -> table_row::const_iterator
auto table_row::begin() const noexcept -> table_row::const_iterator
{
return const_iterator( table_field( *this, m_offset ) );
}

auto table_row::end() const -> table_row::const_iterator
auto table_row::end() const noexcept -> table_row::const_iterator
{
return const_iterator( table_field( *this, m_offset + m_columns ) );
}
Expand Down

0 comments on commit 025529f

Please sign in to comment.