/* * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include namespace NEO { template constexpr To safePodCast(From *f) { typedef typename std::remove_pointer::type FromType; typedef typename std::remove_pointer::type ToType; static_assert(std::is_trivially_copyable::value && std::is_standard_layout::value, "Original cast type is not POD"); static_assert(std::is_trivially_copyable::value && std::is_standard_layout::value, "Target cast type is not POD"); return reinterpret_cast(f); } } // namespace NEO