mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
eliminate potential problems
This commit is contained in:
parent
2b0f39e96e
commit
3bea8af992
@ -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>
|
||||
|
||||
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user