Move valptridx operator- into DEFINE_VALPTRIDX_SUBTYPE

This commit is contained in:
Kp 2014-07-27 03:45:26 +00:00
parent b29f2ef7bd
commit d667772b21
2 changed files with 6 additions and 7 deletions

View file

@ -135,6 +135,12 @@ protected:
return {A, o, i}; \
} \
\
static inline name operator-(P Pconst *o, decltype(A) &O) \
{ \
return N(o, o - (&*O.begin())); \
} \
\
name operator-(name, decltype(A) &) = delete; \
#define DEFINE_VALPTRIDX_SUBTYPE(N,P,I,A) \
_DEFINE_VALPTRIDX_SUBTYPE_USERTYPE(N,P,I,A,N##_t,); \

View file

@ -625,13 +625,6 @@ struct object_array_t : public array<object, MAX_OBJECTS>
extern object_array_t Objects;
DEFINE_VALPTRIDX_SUBTYPE(objptridx, object, int16_t, Objects);
static inline objptridx_t operator-(object *o, object_array_t &O)
{
return objptridx(o, o - (&*O.begin()));
}
objptridx_t operator-(objptridx_t, object_array_t &) DXX_CXX11_EXPLICIT_DELETE;
#endif
/*