kopia lustrzana https://gitlab.com/tomaszg/geostat
Add some constexpr to some functions
rodzic
48f92e64d8
commit
816c94049a
|
@ -5,11 +5,6 @@
|
|||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <iterator>
|
||||
#include <cmath>
|
||||
|
||||
float degtorad(float x) {
|
||||
return x * M_PI / 180;
|
||||
}
|
||||
|
||||
void htmlencode(std::string& data) {
|
||||
std::string tmp;
|
||||
|
@ -41,7 +36,7 @@ void htmlencode(std::string& data) {
|
|||
data.swap(tmp);
|
||||
}
|
||||
|
||||
static std::string string_mangle(const std::string& str) {
|
||||
constexpr static std::string string_mangle(const std::string& str) {
|
||||
std::string tmp;
|
||||
tmp.reserve(str.size());
|
||||
|
||||
|
|
9
common.h
9
common.h
|
@ -1,13 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
// #include "cache.h"
|
||||
// #include "powertrail.h"
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
|
||||
class Cache;
|
||||
|
||||
|
@ -68,7 +66,8 @@ public:
|
|||
explicit Position(std::string loc);
|
||||
};
|
||||
|
||||
|
||||
float cache_distance(const Cache& a, const Cache& b);
|
||||
|
||||
float degtorad(float x);
|
||||
constexpr float degtorad(float x) {
|
||||
return x * M_PI / 180;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue