Boost logo

Boost Users :

Subject: Re: [Boost-users] Unique parameter values for interfaces
From: Eugene Wee (crystalrecursion_at_[hidden])
Date: 2009-05-06 03:00:21

On Wed, May 6, 2009 at 2:12 PM, Ryan McConnehey <mccorywork_at_[hidden]> wrote:
> I realized later that this method doesn't prevent the swapping of a
> ConfigName with a PathName parameter.  Since both parameters are typedef to
> the same "type" of ParameterValue they're interchangeable.  Is there a boost
> class, library or C++ idiom that would provide what I'm looking for?  Since
> I'm going to be using this concept for other classes I build, I'd like
> something that would easily create parameter classes to use but not be
> interchangeable with other classes of the same type.  I know that I could do
> this with a macro but I'm leaving that for a last resort.

One way to do this is to simply define new types instead of using
typedef to create different aliases for the same type.

As for Boost, I guess that Boost.Parameter could help you allow your
users to avoid the mistake of mixing up the arguments by way of named

Eugene Wee

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at