Perhaps not, but I still wouldn't be sure how the macro was intended to work.
I haven't done much classes and put typedefs inside them while referring to those outside.
Gah, another problem.
First, let's inspect the new Proxy class:
Code:
#define Template template<typename Base, typename Iterator, typename Type>
#define CStringExProxyTmpl CStringExProxy<Base, Iterator, Type>
Template class CStringExProxy
It requires 3 template arguments: the base class and and the iterator between whom it shall delegate communication. And lastly also the type of data the classes are working with.
Alright, so I should go ahead and create a friend for this class in the base class:
Code:
typedef Iterators::CIterator< T, CStringExProxy<CTmplStringBaseTmpl, T, Iterators::CIterator> > iterator;
And right away we hit a problem!
The iterator class must take the Proxy to be used as a template argument, so as we see, we get circular references! This is no go...
So how about passing the types to be used to the iterator class instead of one big type?
Code:
#define CIteratorBaseTmpl CIteratorBase<VecT, Proxy, DerefType, Base>
Template class CIteratorBase:
public boost::addable<CIteratorBaseTmpl, uint32_t>,
public boost::subtractable<CIteratorBaseTmpl, uint32_t>,
public std::iterator<std::random_access_iterator_tag, VecT>
{
public:
TYPE_FRIENDLY(Proxy<Base, VecT, CIteratorBaseTmpl>);
Well, it would have worked fine, so long as the name of the class to be used as proxy wasn't passed!
What's a good solution on this? Hard-code the class name? Or is there, yet again, some special syntax that allows me to append more template types to another template type?