<Alexander G. Riccio> via llvm-dev
2016-Jan-30 23:04 UTC
[llvm-dev] Question: C-style casting in Casting.h
I was poking through the black magic in Casting.h, and I see this
interesting struct/function:
template<class To, class FromTy> struct
cast_convert_val<To,FromTy,FromTy> {
// This _is_ a simple type, just cast it.
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy
&Val) {
typename cast_retty<To, FromTy>::ret_type Res2
= (typename cast_retty<To,
FromTy>::ret_type)const_cast<FromTy&>(Val);
return Res2;
}};
Why is the C-style cast needed?
Sincerely,
Alexander Riccio
--
"Change the world or go home."
about.me/ariccio
<http://about.me/ariccio>
If left to my own devices, I will build more.
⁂
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20160130/9ca2a112/attachment.html>
