Boost logo

Boost Users :

Subject: Re: [Boost-users] Help with shared_ptr and template
From: Samurai Deeper (typhoonking77_at_[hidden])
Date: 2010-09-10 09:38:58


what if I want to make it as a composition class?

by example

/***************example**********/
#include "Type.h"
#include "CValue.h"

template<typename T>
class DIP //digital image processing
{
  public:
    DIP();
    virtual ~DIP();
    shared_ptr < Type<T, filter> >createMediumFilter();
};

template<typename T>
DIP<T>::DIP()
{}

template<typename T>
DIP<T>::~DIP()
{}

template<typename T>
shared_ptr< Type<T, filter> > DIP<T>::createMediumFilter()
{
  typename Type<T, filter>::pValue c(new mediumFilter< T >);
  return c;
}
/*****************end**************/

I want to create the instance of mediumFilter like this in the main function

int main()
{
  Type<matrix<double>, Composition>::pValue C(new Composition<matrix<double>
>);
  Type<matrix<double>, CValue>::pValue D;
  D = C->createCValue();

  cout<<"system pause"<<endl;
  cin.get();
}

how could I fix the problems?
thanks

-- 
View this message in context: http://old.nabble.com/Help-with-shared_ptr-and-template-tp21699259p29676966.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net