Boost logo

Boost :

Subject: Re: [boost] [filesystem] Version 3 request for comments
From: Beman Dawes (bdawes_at_[hidden])
Date: 2009-02-11 11:45:36


On Wed, Feb 11, 2009 at 11:18 AM, vicente.botet
<vicente.botet_at_[hidden]> wrote:
> Hi,
> the question is how the user will use these enumerations. if BOOST_NO_SCOPED_ENUM is not defined the user can write
>
> file_type e = file_type::file_not_found;
>
> which will not evidently compile when defined. How can we force the user to write
>
> file_type_enum e = file_type::file_not_found;
>
> which is not intuitive, i.e. there is no explicit relation between file_type_enum and file_type.

Agreed.

> What about making this relation explicit using a metafunction?
>
> I'm don't know if the following is clearer
>
> enumeration<file_type>::type e = file_type::file_not_found;

That doesn't seem any clearer.

Maybe the enum should just be moved into class file_status. That would
limit the scope of the constants, so the _file could be dropped. Might
be simpler, and there is no C++03 compatibility issue.

 --Beman


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