So I recently began an undertaking to convert all the core functionality of a simple engine I made into libraries so that I can compile a lot faster. When I sat down and started breaking things down I realized adding some functionality would make the task easier.
I have added an asset allocator, will be adding an asset factory, and am currently trying to add an asset pool. All of these classes have been designed with template methods. I even figured out how to prevent compilation of the methods when used with an object not derived from my GameAsset class. I needed a way to compare types, and a friend suggested I avoid RTTI. So I solved my problem with another metaprogramming solution.
Which is as follows:
1.) Create a simple class(Registrar) with a static counter which can provide unique type ids as unsigned int values starting at 1.
2.) Create a template singleton class(RegistryEntry<T>) which will access Registrar and store the unique id acquired.
The usage was intended to be quite simple with RegistryEntry<T>::Instance().Get_ID(); I even implemented a macro to perform the implementations of the TypeID() virtual method inside the GameAsset classes. This is where I am now.
The post-instigating problem is that I can't tell if some code will compile properly in 2 or 3 weeks when I am ready to compile code which will test these new features. Which is bad if you ask me, I'd like to know if something is going to compile before I start building upon it. The code is this line: RegistryEntry<T>::Instance().Get_ID(); The syntax is clearly highlighted, properly, by vs2013 intellisense but only for the macro. My use in the Asset_Pool class is not highlighted though.
class Asset_Pool is not a template however the method Get(uint N) is.
method signature is just this:
template<class T>
T* Get(uint N)
My first thought was that intellisense is just acting up as it often does and was merely unable to deduce the implied meaning of the line of code without a thorough look(ie. compiling it). Then I thought how awful it would be if I had to rewrite a bunch of code if this line won't compile.
So I am hoping there are some opinions, advice, and general tips to curb such problems. Perhaps a way to deduce on my own whether syntax isn't highlighting because I screwed up or because intellisense screwed up.
As a side note, I'm sorry I couldn't generalize the post as much as I'd like to given the topic title.