Skip to content

Commit

Permalink
Fix minor issues with string & vector
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Oct 24, 2024
1 parent 9f36b0e commit acd4099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/plugify/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ namespace plg {

constexpr void swap(basic_string& str) noexcept(alloc_traits::propagate_on_container_swap::value || alloc_traits::is_always_equal::value) {
if (this == &str)
return *this;
return;
using std::swap;
swap(this->storage, str.storage);
swap(this->_alloc, str._alloc);
Expand Down
2 changes: 1 addition & 1 deletion include/plugify/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ namespace plg {
}
}
[[nodiscard]] constexpr size_type capacity() const noexcept {
return _end_of_storage - _start;
return static_cast<size_type>(_end_of_storage - _start);
}
constexpr void shrink_to_fit() {
// do shrink only when capacity > 2*size(), just a choice of implementation, no sepcial meaning
Expand Down

0 comments on commit acd4099

Please sign in to comment.