Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2003-01-28 08:05:55


"Daniel Yerushalmi" <daniel_zy_at_[hidden]> wrote in message
news:b15dfk$h89$1_at_main.gmane.org...
> In visual C 7
> The result are:
Thanks...
but I was unforgivable lazy and post an Ill-formed program (should have
tested first!)

Could you tyr again with this corrected version?

template<class T>
struct X
{
  X();
  X ( X const& ) ;
  template<class U> X ( X<U> const& ) ;
} ;

template<class T>
struct Y
{
  Y();
  Y ( Y const& ) ;
  explicit template<class U> Y ( Y<U> const& ) ;
} ;

template<class T> void eat ( X<T> ) ;
template<class T> void eat ( Y<T> ) ;

int main()
{
  X<int> x1 ;
  X<int> x2 = x1;
  eat(x1);

  Y<int> y1 ;
  Y<int> y2 = y1;
  eat(y1);
}

Thanks,


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk