Parameter conversion not allowed

To add comments, please log in or register
leiha
26
leiha  

Hi i have a problem with type i think 

Some one can help me to understand how work it ? ty :)

class IndicatorSettings
{
   public:
   IndicatorSettings ( )
   {}
};

class RsiSettings : public IndicatorSettings
{
   public:
   RsiSettings ( )  
      : IndicatorSettings()     
   {}      
};

template < typename T >
class Indicator
{
   public:
   Indicator( ) 
   {}
};

class IRsi : public Indicator < RsiSettings >
{
   public:
   IRsi( ) 
      : Indicator( ) 
   {}
};

class Script
{
   public:
   void add ( Indicator < IndicatorSettings > * oIndicator ) 
   {}
};

IRsi * indic = new IRsi();
Script::add(indic);  // -> 'indic' - parameter conversion not allowed
fxsaber
12703
fxsaber  
class Script
{
   public:
   template < typename T >
   void add ( Indicator <T> * oIndicator ) 
   {}
};
leiha
26
leiha  

fxsaber, You're solution works

But i found like this , it was better for next step.

ty for time ;)


class IndicatorSettings
{
   public:
   IndicatorSettings ( )
   {}
};

class RsiSettings : public IndicatorSettings
{
   public:
   RsiSettings ( )  
      : IndicatorSettings()     
   {}      
};

interface iIndicator
{}

template < typename T >
class Indicator : public iIndicator
{
   public:
   Indicator( ) 
   {}
};

class IRsi : public Indicator < RsiSettings >
{
   public:
   IRsi( ) 
      : Indicator( ) 
   {}
};

class Script
{
   public:
   void add ( iIndicator * oIndicator ) 
   {}
};

IRsi * indic = new IRsi();
Script::add(indic);
To add comments, please log in or register