Solved

How to make a template class a friend?

Posted on 2006-07-10
1
274 Views
Last Modified: 2013-11-17
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?
0
Comment
Question by:mikrodidakt
1 Comment
 
LVL 30

Accepted Solution

by:
Axter earned 125 total points
ID: 17071129
Hi mikrodidakt,
You can not.
It's not allowed by the C++ standards.

Cheers!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question