Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-05-03 22:32:16


Justin M. Lewis wrote:

> A little bit of an overly simple example. How about something more
> like
>
> void MyGetCWD(c_out<std::string> cwd)

[snip]

> Or, how about,
> void GetFileName(c_in_out<std::string> path, const std::string
> &filter) {

[snip]
 
Gosh!, I can't resist... the API above is poor style, AFAICT.
No wonder you are having tons of problems.

You should just return the string. I suggest that you take a peek
at the boost filesystem library for better API designs. Specifically:

    http://www.boost.org/libs/filesystem/doc/path.htm

-- 
Joel de Guzman
joel at boost-consulting.com
http://www.boost-consulting.com
http://spirit.sf.net

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