eliminate potential problems

This commit is contained in:
mutouyun 2018-12-30 21:17:25 +08:00
parent 2b0f39e96e
commit 3bea8af992
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ constexpr auto impl(T* const (& p)) -> IsImplComfortable<T> {
template <typename T>
constexpr auto clear_impl(T* p) -> IsImplComfortable<T, void> {
impl(p)->~T();
if (p != nullptr) impl(p)->~T();
}
template <typename T, typename... P>

View File

@ -51,8 +51,8 @@ using cache_t = mem::vector<byte_t>;
template <std::size_t N>
cache_t make_cache(byte_t const (& data)[N]) {
return {
static_cast<buff_t::value_type const *>(data),
static_cast<buff_t::value_type const *>(data) + N
static_cast<cache_t::value_type const *>(data),
static_cast<cache_t::value_type const *>(data) + N
};
}