|
Boost Users : |
From: me22 (me22.ca_at_[hidden])
Date: 2005-05-14 01:06:29
On 13/05/05, Arne Vogel <Arne.Vogel_at_[hidden]> wrote:
> The article you linked to doesn't mention typedefs, it's about the
> alleged harmfulness of exceptions
> (and it seems poor Joel just didn't understand Resource Acquisition is
> Initialization in C++ or try-finally
> in Java/C#).
>
As quite a number of people are mentioning in his forum =)
> Am I right to assume that with "strong typedef" you mean something like
> a typedef, but where
> each identifier defined in this way is an actual type and not just an alias?
>
That's the idea, yes. The idea is to make it so that assigning an
unsafe_string to a safe_string ( yes, the names are vague, but they're
from the article ) either invalid or cause an applicable
transformation function to be called so the resulting safe_string
isn't unsafe, despite both being basically just a std::string
I started a topic on Joel's forum about it that includes a
preliminary, but working, version of the class and an ( oversimplified
) example use case. It's at
http://discuss.joelonsoftware.com/default.asp?joel.3.126259.24 if
you're interested. I'd also appreciate some design and/or
implementation feedback if anyone does check it out. As mentioned,
it's my first try at creating a sort of policy-based ( if that's the
correct term ) class as well as my first time using boost's SFINAE
tools.
Regards,
Scott McMurray
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net