joeGrammar
Programmer
I'm assuming this is a template problem, or a problem with setting up the pointer_to_binary_function object, but anyhoo we'll see what we can do...
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Occurs:
void SortElements( int (*fCmp)( const TCPtr*ppe1,const TCPtr *ppe2 ) )
{
sort( vector<T*>::begin(), vector<T*>::end(),
----> qsort2sort(std:tr_fun(fCmp)) );
}
(where ptr_fun is a pointer_to_binary_function)
where qsort2sort:
template <class DataType>
QsortCmpToSortLess<DataType>
qsort2sort(const std:ointer_to_binary_function<const DataType *,const DataType *, int>& qSrtCmp)
{
return QsortCmpToSortLess<DataType>(qSrtCmp);
}
and QsortCmpToSortLess is a class:
template <class DataType>
class QsortCmpToSortLess
: public std::binary_function<DataType, DataType, bool>
{
protected:
typedef std:ointer_to_binary_function<const DataType *,const DataType *, int> FunPtr;
FunPtr qSrtCmp;
public:
typedef DataType second_argument_type;
typedef DataType first_argument_type;
typedef bool result_type;
explicit QsortCmpToSortLess (const FunPtr& x) : qSrtCmp(x) {}
bool operator() (const first_argument_type& x,
const second_argument_type& y) const
{
return qSrtCmp( &x, &y) < 0 ? true : false;
}
};
Anyways any help would be appreciated for this is one HATED error Thanks
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Occurs:
void SortElements( int (*fCmp)( const TCPtr*ppe1,const TCPtr *ppe2 ) )
{
sort( vector<T*>::begin(), vector<T*>::end(),
----> qsort2sort(std:tr_fun(fCmp)) );
}
(where ptr_fun is a pointer_to_binary_function)
where qsort2sort:
template <class DataType>
QsortCmpToSortLess<DataType>
qsort2sort(const std:ointer_to_binary_function<const DataType *,const DataType *, int>& qSrtCmp)
{
return QsortCmpToSortLess<DataType>(qSrtCmp);
}
and QsortCmpToSortLess is a class:
template <class DataType>
class QsortCmpToSortLess
: public std::binary_function<DataType, DataType, bool>
{
protected:
typedef std:ointer_to_binary_function<const DataType *,const DataType *, int> FunPtr;
FunPtr qSrtCmp;
public:
typedef DataType second_argument_type;
typedef DataType first_argument_type;
typedef bool result_type;
explicit QsortCmpToSortLess (const FunPtr& x) : qSrtCmp(x) {}
bool operator() (const first_argument_type& x,
const second_argument_type& y) const
{
return qSrtCmp( &x, &y) < 0 ? true : false;
}
};
Anyways any help would be appreciated for this is one HATED error Thanks