wheybags / freeablo

[ARCHIVED] Modern reimplementation of the Diablo 1 game engine
GNU General Public License v3.0
2.16k stars 193 forks source link

388 replace boost ini parser #403

Closed balintkissdev closed 5 years ago

balintkissdev commented 5 years ago

Fixes #388

balintkissdev commented 5 years ago

First I thought about using const for the defaultValue and value parameters like this

template <class T> T get(const std::string& section, const std::string& name, const T defaultValue = T());
template <class T> void set(const std::string& section, const std::string& name, const T value);

because it's my design philosophy that having const function parameters helps detecting bugs earlier while maintaining the function implementation. Not sure if you had other intentions by keeping those parameters as they are.

const T& defaultValue = T() would be great for std::string parameters, but utter waste for primitives like bool and int.

wheybags commented 5 years ago

Thanks for the PR!