SpaIot Library
Loading...
Searching...
No Matches
type_name.h
1/*
2 SpaIot Library (c) by epsilonrt - epsilonrt@epsilonrt.fr
3 This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4
5 SPDX-License-Identifier: BSD-3-Clause
6
7 SpaIot library is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY;
9*/
10#pragma once
11
12#include <Arduino.h>
13
22template <class T>
23String type_name (const T &) {
24 String s = __PRETTY_FUNCTION__;
25 int start = s.indexOf ("[with T = ") + 10;
26 int stop = s.lastIndexOf (']');
27 return s.substring (start, stop);
28}