|
|
|
|
|
|
y***a 发帖数: 840 | 1 src code is there:
http://stuff.mit.edu/afs/athena.mit.edu/software/gccgo/current/src/elfcpp/elfcpp_swap.h
问一下在Convert_endian里老使用typedef有什么好处:
比如在164行:
template<>
struct Convert_endian<8, false>
{
typedef Valtype_base<8>::Valtype Valtype; <--- line 164
static inline Valtype
convert_host(Valtype v)
{ return v; }
};
既然已经在做specialization, 直接用uint8_t不就好了吗?z这个Valtype_base<>模板
有什么好处?我没想明白 | t****t 发帖数: 6806 | 2 this leaves you some freedom to use a different type in the future.
【在 y***a 的大作中提到】 : src code is there: : http://stuff.mit.edu/afs/athena.mit.edu/software/gccgo/current/src/elfcpp/elfcpp_swap.h : 问一下在Convert_endian里老使用typedef有什么好处: : 比如在164行: : template<> : struct Convert_endian<8, false> : { : typedef Valtype_base<8>::Valtype Valtype; <--- line 164 : static inline Valtype : convert_host(Valtype v)
| y***a 发帖数: 840 | 3 it makes sense to me. thx
【在 t****t 的大作中提到】 : this leaves you some freedom to use a different type in the future.
|
|
|
|
|
|
|