• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What is the proper syntax for this?

Red Squirrel

No Lifer
I have a template class that I want to add an object of in a vector, I'm trying this but it's not compiling, so I'm guessing there must be another way:

xVector<SP<DataClass>> vect;


xVector is a template class, and so is SP, so I want to put a SP that holds a DataClass into the vector.

xVector is a wraper of Vector that I made for ease of use, do I maybe need to overload something for this to work?
 
Depends on the compiler. If I'm not mistaken, the MSVC compiler will handle that. GCC and its ilk will choke.

The safe way to do it is like this.

xVector < SP < DataClass > > vect;

The main problem is the >> , which counts as a bit shift right operator. I guess you could technically write it like

xVector<SP<DataClass> > vect;

Whatever floats your boat.
 
Back
Top