fix implicit conversion warnings by making them explicit

This commit is contained in:
Bernd Amend 2021-05-22 15:46:16 +02:00
parent 532f044bd3
commit 14e9ec6e97
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ namespace chaiscript {
}
[[nodiscard]] constexpr std::size_t size() const noexcept {
return m_end - m_begin;
return std::size_t(m_end - m_begin);
}
[[nodiscard]] std::vector<Boxed_Value> to_vector() const {

View File

@ -325,7 +325,7 @@ namespace chaiscript
static std::string_view str(const Position &t_begin, const Position &t_end) noexcept {
if (t_begin.m_pos != nullptr && t_end.m_pos != nullptr) {
return std::string_view(t_begin.m_pos, std::distance(t_begin.m_pos, t_end.m_pos));
return std::string_view(t_begin.m_pos, std::size_t(std::distance(t_begin.m_pos, t_end.m_pos)));
} else {
return {};
}