sorry, I forgot to change the names of those classes.
I am deeply sorry for my unconscious
/***********CValue**********/
template< typename tvalue >
class CValue
{
public:
CValue( tvalue value ) : value_(value) {};
private:
tvalue value_;
};
/***********end of CValue*********/
/***********Type**************/
template
struct Type
{
typedef boost::shared_ptr< Value<T> > pValue;
};
/********end of Type************/
/**********Composition**********/
template<typename T>
class Composition //digital image processing
{
public:
Composition();
virtual ~Composition();
shared_ptr< T > createCValue();
};
template<typename T>
Composition<T>::Composition()
{}
template<typename T>
Composition<T>::~Composition()
{}
template<typename T>
shared_ptr< T > Composition<T>::createCValue()
{
typename Type::pValue c(new Composition< T >);
return c;
}
/*********end of composition***********/
/**********main************/
int main()
{
Type::pValue C(new Composition
);
Type::pValue D;
D = C->createCValue();
cout<<"system pause"<http://old.nabble.com/some-problems-about-shared_ptr-tp29674340p29682576.htm...
Sent from the Boost - Users mailing list archive at Nabble.com.