// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "utils.h" #include #include namespace search::features::util { template T strToNum(vespalib::stringref str) { vespalib::asciistream iss(str); T retval = 0; try { iss >> retval; } catch (const vespalib::IllegalArgumentException &) { } return retval; } }