SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
descriptions.hpp
Go to the documentation of this file.
1/*
2 * get description of variables.cpp
3 *
4 * Free functions to help to write everything shorter.
5 *
6 * Created on: 05 Apr 2022
7 * Author(s): Jorn Reniers, Volkan Kumtepeli
8 */
9
10#pragma once
11
12#include <string_view>
13
14template <typename T>
15consteval int find_description(std::string_view x)
16{
17 for (size_t i = 0; i < T::description.size(); i++) {
18 if (x == T::description[i])
19 return i;
20 }
21
22 return -1;
23}
consteval int find_description(std::string_view x)
Definition: descriptions.hpp:15