Have you ever tried to implement foreach loop macro in C++? If you tried, you know that it's almost impossible to do it, because you have to initialize the reference to iterated value in the initialization section of the for loop (i.e. immediately after… more »
Categories: Programming, Snippets
01:39:00 pm,
As you probably already know, in C++, it's impossible to modify reference variables once they are initialized. Also you can't even get address of reference variable, so it's not possible to cast them to pointers of pointers.
Well, everything is poss… more »
Categories: Programming, Snippets
04:05:00 am,
Yesterday, I was working on a memory pool for fixed size allocations, which I needed for smaller data types, because the current memory allocator (I'm using nedmalloc) wastes a lot of memory for it's meta data and alignment padding (one allocated 32 bit… more »
Categories: Programming
01:39:00 pm,
Sometimes you need to exchange (swap) two objects, or you need to copy objects without using their assignment operator nor copy constructor. Normally you would probably copy data using standard memcpy function. But in this case, memcpy can be really slo… more »
Categories: Programming, Snippets
11:50:00 am,
Here's VS macro for searching and converting upper cased constants and enumerations to camel case style. For example, you can convert string like "ENTITY_FLAG_VISIBLE" to "EntityFlagVisible" or even better to "Entity::FlagVisible" in whole solution. Ver… more »
Categories: Programming, Snippets
09:16:00 am,
