3-phase PV router
Loading...
Searching...
No Matches
Mk2_3phase_RFdatalog_temp
type_traits
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
21
template
<
typename
From,
typename
To >
22
struct
is_convertible
23
{
24
protected
:
// <- 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
declval.hpp
is_convertible
Definition:
is_convertible.hpp:23
is_convertible::probe
static char probe(...)
is_convertible::probe
static int probe(To)
is_convertible::value
static const bool value
Definition:
is_convertible.hpp:31
is_convertible::from_
static From & from_
Definition:
is_convertible.hpp:28
Generated by
1.9.6