template<typename T>
T get_option_value(const std::string& optionName) {
T ret(0); // to initialize in case of fall-through.
Options::iterator it = option_with_name(optionName);
if (it != options.end())
{
std::istringstream ss(it->currentValue);
ss >> ret;
}
return ret;
}
template<typename T>
T get_option_value(const std::string& optionName) {
T ret(0); // to initialize in case of fall-through.
Options::iterator it = option_with_name(optionName);
if (it != options.end())
{
std::istringstream ss(it->currentValue);
ss >> ret;
}
return ret;
}
Nevermind, it causes an exception to initialize a string to zero.
But this does mean collection of UCI parameters can result in undefined behavior.
First impression:
Stockfish looks really strong. It seems to outsearch everyone. And I am using my MS VC++ build. Jim's build will probably be quite a bit faster.
template<typename T>
T get_option_value(const std::string& optionName) {
T ret(0); // to initialize in case of fall-through.
Options::iterator it = option_with_name(optionName);
if (it != options.end())
{
std::istringstream ss(it->currentValue);
ss >> ret;
}
return ret;
}
Nevermind, it causes an exception to initialize a string to zero.
But this does mean collection of UCI parameters can result in undefined behavior.
template<typename T>
T get_option_value(const std::string& optionName) {
T ret = T(); // to initialize in case of fall-through.
Options::iterator it = option_with_name(optionName);
if (it != options.end())
{
std::istringstream ss(it->currentValue);
ss >> ret;
}
return ret;
}
C++ knows how to correclty initialize built-in types and it does the correct thing also with user defined ones (as long as they have a default and a copy constructor).
Thanks for the hint
Marco
P.S: A little C++ digression. You cannot use the form
Dann Corbit wrote:First impression:
Stockfish looks really strong. It seems to outsearch everyone. And I am using my MS VC++ build. Jim's build will probably be quite a bit faster.
I get extremely low kn/s counts here. Same for others?
Dann Corbit wrote:First impression:
Stockfish looks really strong. It seems to outsearch everyone. And I am using my MS VC++ build. Jim's build will probably be quite a bit faster.
I get extremely low kn/s counts here. Same for others?
Dann Corbit wrote:First impression:
Stockfish looks really strong. It seems to outsearch everyone. And I am using my MS VC++ build. Jim's build will probably be quite a bit faster.
I get extremely low kn/s counts here. Same for others?
It sounds like you might have the same problem as I, where everything gets very slow. This includes opponent engines with ponder off.