
On Wed, Feb 11, 2009 at 11:18 AM, vicente.botet <vicente.botet@wanadoo.fr> 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