Boost logo

Boost :

From: Phil Bouchard (philippe_at_[hidden])
Date: 2008-03-11 03:47:26


"Steven Watanabe" <watanabesj_at_[hidden]> wrote in message
news:47D547F9.8060305_at_providere-consulting.com...

[,,,]

> You should not define now as a macro. Not to mention that now
> is a very non-descriptive name. IMO, it should be spelled
> make_shifted_ptr<T>();

That is exactly the preferred way to wrap the constructor but I wanted to
demonstrate it is perfectly and type-safe to use that macro as an
alternative for this unique case. It does not limit in any way also the
number of arguments and doesn't prevent usages of non-constant argument if
the make_shifted_ptr<>() adds such modifier.

The "now" keyword should be read as an interjection between the pointee and
the pointer meaning: "the object pointed to by P is now a D". In the case
the object created by "now" isn't affected to any pointer then the code
isn't human-redable anymore. Ex.:

shifted_ptr<int> P = now (int)(9); // Ok
now (int)(10); // Apocryphal

Nevertheless I will add the wrapper function but I haven't seen standard
support for variable argument listing.

-Phil


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