How do I deal with “signed/unsigned mismatch” warnings (C4018)?

It’s all in your things.size() type. It isn’t int, but size_t (it exists in C++, not in C) which equals to some “usual” unsigned type, i.e. unsigned int for x86_32. Operator “less” (<) cannot be applied to two operands of different sign. There’s just no such opcodes, and standard doesn’t specify, whether compiler can make … Read more

How to implement polymorphic associations in an existing database

You could use Option 1 but without an additional surrogate Alternate Key. Instead, extend the existing Primary Key (of each entity), with an EntityType column (say CHAR(1), that would be E for Events, P for Persons, D for Products). The compound (EntityId, EntityType) will become then the Primary Key of table Entity and the corresponding … Read more