Agora
1.2.0
Agora project
utils.h
Go to the documentation of this file.
1
//
2
// Copyright(c) 2015 Gabi Melman.
3
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
4
//
5
6
#pragma once
7
8
#include <iomanip>
9
#include <locale>
10
#include <sstream>
11
12
namespace
utils
{
13
14
template
<
typename
T>
15
inline
std::string
format
(
const
T
&value)
16
{
17
static
std::locale loc(
""
);
18
std::stringstream ss;
19
ss.imbue(loc);
20
ss << value;
21
return
ss.str();
22
}
23
24
template
<>
25
inline
std::string
format
(
const
double
&value)
26
{
27
static
std::locale loc(
""
);
28
std::stringstream ss;
29
ss.imbue(loc);
30
ss << std::fixed << std::setprecision(1) << value;
31
return
ss.str();
32
}
33
34
}
// namespace utils
T
T
Definition:
simulate_performance.m:4
utils
Definition:
utils.h:12
utils::format
std::string format(const T &value)
Definition:
utils.h:15
third_party
spdlog
bench
utils.h
Generated by
1.8.17