Skip to content

Proposal: out_of_range should be a subclass of std::out_of_range #756

Closed
@adityamarella

Description

class out_of_range : public exception

Is there any reason not to inherit out_of_range exception from std::out_of_range?

The current release version v2.1.1 is throwing std::out_of_range but the latest on develop throws custom out_of_range exception which could cause backward compatibility issues.

My code below was working with v2.1.1 release version, stopped working when I moved to the latest on develop

try {
    json.at("xxx")
} catch(std::out_of_range &e) {
   ...
}

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions