LINUX.ORG.RU

История изменений

Исправление intelfx, (текущая версия) :

Как грамотно различать ошибки при работе с файловыми потоками (std::ofstream)?

Ловить std::ios_base::failure.

27.5.3.3.1 параграф 2:

When throwing ios_base::failure exceptions, implementations should provide values of ec that identify the specific reason for the failure. [ Note: Errors arising from the operating system would typically be reported as system_category() errors with an error value of the error number reported by the operating system. Errors arising from within the stream library would typically be reported as error_code(io_errc::stream, iostream_category()). — end note ]

Исходная версия intelfx, :

Как грамотно различать ошибки при работе с файловыми потоками (std::ofstream)?

Ловить std::ios_base::failure.