Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Fixed std::runtime_error usage (use C++03 version instead of C++11) #2184

Merged

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Nov 12, 2021

Added missing include of <stdexcept>.

Also there are several versions of the runtime_error constructor:

std::runtime_error( const std::string& what_arg ); // C++03
std::runtime_error( const char* what_arg );  // since C++11

The error message argument of the std::runtime_error is copied to an internal member of the runtime_error, so the initial object does not have to remain valid after an exception is thrown.

If C++03 is used, an implicit conversion from const char* to std::string should happen.

To Consider

  • m_strIndexErr could be defined in srterror_defs.cpp.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Nov 12, 2021
@maxsharabayko maxsharabayko added this to the v1.4.5 milestone Nov 12, 2021
@maxsharabayko maxsharabayko merged commit 5f3cd06 into Haivision:master Nov 12, 2021
@maxsharabayko maxsharabayko deleted the hotfix/cxx11-runtime-error branch November 12, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant