Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2007-10-31 14:28:40


> Actually, the user *can* use the enum without <winerror.h>.

I see this in error_code.hpp:

namespace windows_error
{
  enum windows_error_code
  {
    success = 0,
    // These names and values are based on Windows winerror.h
    invalid_function = ERROR_INVALID_FUNCTION,
    file_not_found = ERROR_FILE_NOT_FOUND,
    path_not_found = ERROR_PATH_NOT_FOUND,
    ....
  }
}

I don't understand how this enum can be compiled without including <winerror.h>.

> How about a BOOST_SYSTEM_NO_ENUM macro, which suppresses the system
> specific enum?

Perhaps the enum should be placed in a platform-specific header, for
example "boost/system/windows/error_code.hpp"?

Also, how do you feel about replacing the OS-specific enums with plain
ints? This way, I can compare error codes directly to the values from
<winerror.h> (I understand that enums give us type safety, but
unfortunately they can not be incomplete types, which leads to
physical coupling and causes the kind of problems I'm hitting with
error_code.hpp.)

-- 
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

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