Utility Rack
Loading...
Searching...
No Matches
cast_ptr_to.hpp
Go to the documentation of this file.
1
29#ifndef CAST_PTR_TO_HPP_INCLUDED
30#define CAST_PTR_TO_HPP_INCLUDED
31
32namespace chops {
33
34template <typename Dst, typename Src>
35const Dst* cast_ptr_to (const Src* p) noexcept {
36 return static_cast<const Dst*> (static_cast<const void*> (p));
37}
38
39template <typename Dst, typename Src>
40Dst* cast_ptr_to (Src* p) noexcept {
41 return static_cast<Dst*> (static_cast<void*> (p));
42}
43
44} // end namespace
45
46#endif
47