Boost logo

Boost :

From: Emily Winch (emily_at_[hidden])
Date: 2002-02-21 06:47:25


Peter Dimov wrote:

[ typeof and auto stripping const/reference ]

> typeof(std::cout << 5) void f()
> {
> return std::cout << 5;
> }

A nastier example: imagine the "at" function for a hypothetical heterogenous
vector.

hvec<int, double, long, char> vec;

vec.at<3>() = 5; // no problem

auto obj = vec.at<3>();

// ...

obj = 6; // compiles, runs, doesn't work

Emily.


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