Ladies and gentle men, I bring to you, the Binteger (bool + int).
They called me crazy!
I'm interpreting "B integer" more as an imperative. Like, be the integer. Let the scalar wholeness into your soul, man.
This reminds me of S_FAIL for some reason. You may have succeeded, but in the end, its still a failure.
Actual (sanitized) quote from actual game source I've worked on:
#define NET_ERR_UNEXPECTED_SUCCESS DEF_ERROR(NET_ERR_BASE + 3)
Actual (sanitized) quote from actual game source I've worked on:
#define NET_ERR_UNEXPECTED_SUCCESS DEF_ERROR(NET_ERR_BASE + 3)
Unexpected success, aye? To me, that sounds like an issue that only Guild Wars 2 would encounter
But does it support FILE_NOT_FOUND?
I believe boosts tribool still does this wrong as well, by not defining the third states value.
washu wrote me this :)
struct beufint_t {
public:
beufint_t () : t(et::n), u(0) {}
beufint_t (bool b) : t(et::b), b(b) {}
beufint_t (float f) : t(et::f), f(f) {}
beufint_t (int i) : t(et::i), i(i) {}
beufint_t (unsigned u) : t(et::u), u(u) {}
operator bool () const { return t == et::b ? b : false; }
operator int () const { return t == et::i ? i : 0; }
operator float () const { return t == et::f ? f : 0; }
operator unsigned () const { return t == et::u ? u : 0; }
operator void const * () const { return t != et::n ? this : 0; }
bool operator () (bool) const { return t == et::b; }
bool operator () (int) const { return t == et::i; }
bool operator () (float) const { return t == et::f; }
bool operator () (unsigned) const { return t == et::u; }
private:
enum class et {
b,
f,
i,
u,
n
};
union {
bool b;
float f;
int i;
unsigned u;
};
et t;
};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement