Topic: Typeof proposal


Author: Hyman Rosen <hymie@prolifics.com>
Date: 1999/08/25
Raw View
Here's a more elaborate form of my minimalist typeof proposal:

In section 7.1.5.2 [dcl.type.simple], add the following
to the list of simple-type-specifier alternatives:

 typeof ( expression )

In table 7, add the pair

 typeof(expression) The deduced type of the expression.

Add this paragraph at the end of 7.1.5.2

 Assume the presence of the declarations

 namespace std
 {
  template <typename T>
  T __typeof(T &);
  template <typename T>
  const T __typeof(const T &);
  template <typename T>
  volatile T __typeof(volatile T &);
  template <typename T>
  volatile const T __typeof(volatile const T &);
 }

 The simple-type-specifier typeof(expression) specifies the
 deduced return type of the call std::__typeof(expression).
 The expression is not evaluated.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]