blob: d91612bc0941b45fbb36a2826d56a5cfe47befb3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "parameters.h"
#include <vespa/vespalib/stllike/asciistream.h>
namespace vdslib {
template<typename T>
T
Parameters::get(KeyT id, T def) const {
vespalib::stringref ref;
if (!lookup(id, ref)) return def;
vespalib::asciistream ist(ref);
T t;
ist >> t;
return t;
}
}
|