3-phase PV router
Loading...
Searching...
No Matches
is_convertible.hpp
Go to the documentation of this file.
1// ArduinoJson - https://arduinojson.org
2// Copyright © 2014-2023, Benoit BLANCHON
3// MIT License
4
5#pragma once
6
7#include "declval.hpp"
8
9#ifdef _MSC_VER
10#pragma warning(push)
11// conversion from 'T' to 'To', possible loss of data
12#pragma warning(disable : 4244)
13#endif
14
15// clang-format off
16#ifdef __ICCARM__
17// Suppress IAR Compiler Warning[Pa093]: implicit conversion from floating point to integer
18#pragma diag_suppress=Pa093
19#endif
20// clang-format on
21template< typename From, typename To >
23{
24protected: // <- to avoid GCC's "all member functions in class are private"
25 static int probe(To);
26 static char probe(...);
27
28 static From& from_;
29
30 public:
31 static const bool value = sizeof(probe(from_)) == sizeof(int);
32};
33#ifdef _MSC_VER
34#pragma warning(pop)
35#endif
36
37// clang-format off
38#ifdef __ICCARM__
39#pragma diag_default=Pa093
40#endif
41// clang-format on
static char probe(...)
static int probe(To)
static const bool value
static From & from_