My requirement is to get an item from a collection using extern "c" function. The method will be as below
template<class _Ty,
class _Alloc = allocator<_Ty> >
extern "C" __declspec(dllexport) _Ty* __cdecl GetItem(std::vector<_Alloc>* itr, int index)
{
if (itr->size() < index)
return NULL;
return &itr->at(index);
}
While compiling im getting an error as below
error C2988: unrecognizable template declaration/definition
The use of this extern method is to get object data using pinvoke from c#