why doesnt this work?
I get error C2664 ... Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castCode:// global struct s { float x; float y; }; // set.h Class CSet { std::vector<s> mStructData; std::vector<int> m_intData; template<typename T> void inline setdata( std::vector<T>& TData ) { if ( m_bool == TRUE ) m_StructData.assign( TData.begin(), TData.end() ); else m_intData.assign( TData.begin(), TData.end() ); }; }; /***********************************************/ //try.h CSet m_Set; // try.cpp std::vector<s> sData; std::vector<int> intData; if ( m_bool ) m_Set.setdata( sData ); else m_Set.setdata( intData );
... C\...\try.cpp(178) : see reference to function template instantiation ...
Thx.




Reply With Quote