Link to home
Start Free TrialLog in
Avatar of mikrodidakt
mikrodidakt

asked on

How to make a template class a friend?

template<class T> struct plotvalue : public std::unary_function<T, void>
{
  plotvalue(//GraphHandler& g) : gh(g) {}
  void operator() (T x) {
        if(x.Param_code == 0x00000002) {
                double time = (x.Time - gh.start_time)/60;
                gh.series.AddXY(time, x.Measure_Value);
         }
  }
  GraphHandler& gh;
};
//---------------------------------------------------------------------------
class GraphHandler {
        friend template<class T> struct plotvalue : public std::unary_function<T, void>
        public:
                GraphHandler(TCustomSeries& s, TChart& c, TChartEditor& ce);
                void plot(MessageHandler& mh, TCustomSeries* series);
        private:
                bool first_time;
                TCustomSeries& series;
                TChart& chart;
                TChartEditor& chartEditor;
                unsigned __int32 start_time;
};

because this dose't work? Or is it even possible?
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial