Opened 8 years ago

Last modified 7 years ago

#4133 new Bugs

std::logic_error as a base class for program_options::error

Reported by: anonymous Owned by: Vladimir Prus
Milestone: Boost 1.43.0 Component: program_options
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:


"19.1 Exception classes

1 The Standard C + + library provides classes to be used to report certain errors ( in C + + programs. In the error model reflected in these classes, errors are divided into two broad categories: logic errors and runtime errors.

2 The distinguishing characteristic of logic errors is that they are due to errors in the internal logic of the pro- gram. In theory, they are preventable.

3 By contrast, runtime errors are due to events beyond the scope of the program. They cannot be easily pre- dicted in advance. The header <stdexcept> defines several types of predefined exceptions for reporting errors in a C + + program. These exceptions are related by inheritance."

From what POV po::unknown_option is 'due to errors in the internal logic of the program'? All po:: errors should be separated into two groups (runtime and logic) or std::exception should be used as a base class.

Change History (1)

comment:1 Changed 7 years ago by olafvdspek@…

I'd like to see this fixed too.

Note: See TracTickets for help on using tickets.