Topic: Q: Reference Types as Template Arguments - legal?


Author: Misha Dorman <mishad@iplbath.com>
Date: 1996/08/09
Raw View
Are reference types allowed as template arguments?

i.e. is the following legal?

> template<class T> class X
>  {
>  // ...
>  };
>
> X<int&> xir;

If not, can anyone provide a reference (to April 95 or Jan 96 draft wp)
which states this.

If so, then what happens with

> template<class T> class X
>  {
>  T       & rt;
>  T const & rct;
>  // ...
>  };
>
> X<int&> xir;

What is the type of X<int&>::rt? X<int&>::rct?

Thanks in advance for any clues


--
Misha Dorman                             email: mishad@iplbath.com
Software Products Group                  WWW:   http://www.iplbath.com
IPL Information Processing Ltd           Tel:   +44 (0)1225 444888
Eveleigh House, Grove Street, Bath BA1 5LR, England
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]