Minor: Use template parameter default values for OffsetTo
This commit is contained in:
parent
546b1adcdc
commit
0d1b3419a7
|
@ -696,8 +696,8 @@ struct FixedVersion
|
||||||
* Use: (base+offset)
|
* Use: (base+offset)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename OffsetType, typename Type>
|
template <typename Type, typename OffsetType=Offset>
|
||||||
struct GenericOffsetTo : OffsetType
|
struct OffsetTo : OffsetType
|
||||||
{
|
{
|
||||||
inline const Type& operator () (const void *base) const
|
inline const Type& operator () (const void *base) const
|
||||||
{
|
{
|
||||||
|
@ -737,15 +737,12 @@ struct GenericOffsetTo : OffsetType
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template <typename Base, typename OffsetType, typename Type>
|
template <typename Base, typename OffsetType, typename Type>
|
||||||
static inline const Type& operator + (const Base &base, const GenericOffsetTo<OffsetType, Type> &offset) { return offset (base); }
|
static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
|
||||||
template <typename Base, typename OffsetType, typename Type>
|
template <typename Base, typename OffsetType, typename Type>
|
||||||
static inline Type& operator + (Base &base, GenericOffsetTo<OffsetType, Type> &offset) { return offset (base); }
|
static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType> &offset) { return offset (base); }
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct OffsetTo : GenericOffsetTo<Offset, Type> {};
|
struct LongOffsetTo : OffsetTo<Type, LongOffset> {};
|
||||||
|
|
||||||
template <typename Type>
|
|
||||||
struct LongOffsetTo : GenericOffsetTo<LongOffset, Type> {};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue