Boost logo

Boost Users :

Subject: Re: [Boost-users] Unique parameter values for interfaces
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-05-06 03:45:38


Eugene Wee wrote:
> One way to do this is to simply define new types instead of using
> typedef to create different aliases for the same type.
>
Do you mean like this?

struct ConfigName
{
    ConfigName(std::string const& value_) : value(value_) {}
    std::string value;
};

struct PathName
{
    PathName(std::string const& value_) : value(value_) {}
    std::string value;
};

If so, I'm trying to cut down on code duplication and have a standard
way of accessing my parameter values. By created each parameter value
separately there is nothing that forces the programmer to have
consistent interface to access the value.

Ryan


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