Skip to content

Make a_filename const char* in Load/Save methods #2

Merged
peter-ch merged 1 commit intopeter-ch:masterfrom
avalenzu:master
Nov 25, 2012
Merged

Make a_filename const char* in Load/Save methods #2
peter-ch merged 1 commit intopeter-ch:masterfrom
avalenzu:master

Conversation

@avalenzu
Copy link
Contributor

This affects the Genome, NeuralNetwork, Parameters and Population,
classes. Since a_filename is not modified by the Load/Save methods, it
makes sense for it to be const. Having a_filename be const simplifies
interaction with callers that use std::strings.

The changes are backwards compatible - you can still pass a char* for
a_filename.


Just thought I'd pass this along in case you want to make the package easier to use with std::string.c_str.

Thanks for a good library!

This affects the Genome, NeuralNetwork, Parameters and Population,
classes.  Since a_filename is not modified by the Load/Save methods, it
makes sense for it to be const. Having a_filename be const simplifies
interaction with callers that use std::strings.

The changes are backwards compatible - you can still pass a char* for
a_filename.
@peter-ch
Copy link
Owner

Thank you, I'll try to merge your fixes now.

@peter-ch peter-ch merged commit 56021e8 into peter-ch:master Nov 25, 2012
peter-ch added a commit that referenced this pull request Aug 26, 2019
peter-ch added a commit that referenced this pull request Aug 26, 2019
peter-ch added a commit that referenced this pull request Aug 26, 2019
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