L
Larry
I have the following:
class TZ
{
public:
....
bool operator< ()(const TZ &tz);
....
};
class CL
{
protected:
typedef TZ *PZ;
typedef boost:array<PZ,10000> PZA;
PZA pza;
long pzc; // Number of used elements of pza
.....
bool ZCmp(PZ p1,PZ p2)
{
return p1->a < p2->a;
}
....
void Init()
{
....
std::stable_sort(pza,pza + pzc,ZCmp);
....
}
....
};
I originally tried this with the items of class CL not in a class
and VC was quite happy with it. When I moved things into the CL class
the compiler naturally complained about ZCmp in the stable_sort line
suggesting it needed to be of the &CL::ZCmp form. It is, of course, now
a member function. However, converting to &CL::ZCmp is not sufficient
and the compiler still complains about not being able to deduce the
arguments from the template. I am obviously missing something but I am
too close to it to see. Suggestions?
PZA is not necessarily full so only a partial sort is required hence the
pza,pza +pzc parameters to stable_sort where pzc is index of the last used
array element. There are no empty elements in the range 0 to pzc.
I am using VC9 (VS2008) and Boost 1_54.
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
class TZ
{
public:
....
bool operator< ()(const TZ &tz);
....
};
class CL
{
protected:
typedef TZ *PZ;
typedef boost:array<PZ,10000> PZA;
PZA pza;
long pzc; // Number of used elements of pza
.....
bool ZCmp(PZ p1,PZ p2)
{
return p1->a < p2->a;
}
....
void Init()
{
....
std::stable_sort(pza,pza + pzc,ZCmp);
....
}
....
};
I originally tried this with the items of class CL not in a class
and VC was quite happy with it. When I moved things into the CL class
the compiler naturally complained about ZCmp in the stable_sort line
suggesting it needed to be of the &CL::ZCmp form. It is, of course, now
a member function. However, converting to &CL::ZCmp is not sufficient
and the compiler still complains about not being able to deduce the
arguments from the template. I am obviously missing something but I am
too close to it to see. Suggestions?
PZA is not necessarily full so only a partial sort is required hence the
pza,pza +pzc parameters to stable_sort where pzc is index of the last used
array element. There are no empty elements in the range 0 to pzc.
I am using VC9 (VS2008) and Boost 1_54.
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-