Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: Boost.String.Convert
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-17 17:34:08


AMDG

Emil Dotchevski wrote:
> The issue is not just naming and syntax.
>
> The two approaches are:
>
> 1) Define a "to_string" interface and a separate, independent
> "from_string" interface
>
> 2) Define a single interface that can go to and from string
>
> The second approach introduces coupling between to_string and
> from_string. This coupling must be justified, you need to get
> something in return. The only "something" I see here is that it lets
> you write code which doesn't "know" if it's going "to" or "from"
> string.
>

The only other benefit, is possible syntactic nicity. Note that
this function can be in a very light weight header that forwards
to the correct implementation, so the coupling would be minimal.

> My problem is that I can't think of a case when I would be writing
> code that doesn't "know" if it is going "to" or "from" string. Can
> you?
>

IMO, a use case where exactly one of the arguments is known to be
a string, but it is unknown which one, is unlikely.

In Christ,
Steven Watanabe


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