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

Add const to some char* strings #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

enp1s0
Copy link

@enp1s0 enp1s0 commented May 15, 2021

This pull request adds const to some char* strings.
This allows us to use this library in C++ as follows.

const std::string name = "...";
starsh_problem_new(..., name.c_str(), ...);

Otherwise, we need to remove const using const_cast and it's not safe.

const std::string name = "...";
starsh_problem_new(..., const_cast<char*>(name.c_str()), ...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants