Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-05-13 18:54:51


----- Original Message -----
From: <rcspython_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, May 03, 2001 1:38 PM
Subject: [boost] BPL: How do you actually return a vector from your class?

> I have looked at the simple_vector.cpp file. My question is how do
> you actually incorporate this functionality into an existing class?
> I very much want to return a vector from MY C++ class.

I don't mean to be an overly-literal engineer type, but your questions lack
precision, and that makes them hard to answer. Classes don't "return"
anything in C++. Only functions can return things. Here is an example of a
function which returns a vector of ten doubles valued 0.0:

vector<double> f() { return vector<double>(10); }

If you can try to state very precisely what you're trying to accomplish, you
may have better luck getting help.

Regards,
Dave


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