MRPT
2.0.3
mrpt
core
is_defined.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <type_traits>
// enable_if_t
12
13
namespace
mrpt
14
{
15
/** Checks if type is defined (fails for forward declarations).
16
* \note Credits: WindyFields https://stackoverflow.com/a/45594334/1631514
17
*/
18
template
<
class
T,
class
Enable =
void
>
19
struct
is_defined
20
{
21
static
constexpr
bool
value
=
false
;
22
};
23
template
<
class
T>
24
struct
is_defined
<T, std::enable_if_t<(sizeof(T) > 0)>>
25
{
26
static
constexpr
bool
value
=
true
;
27
};
28
29
template
<
class
T>
30
inline
constexpr
bool
is_defined_v
=
is_defined<T>::value
;
31
32
}
// namespace mrpt
mrpt::is_defined
Checks if type is defined (fails for forward declarations).
Definition:
is_defined.h:19
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
BaseAppDataSource.h:15
mrpt::is_defined_v
constexpr bool is_defined_v
Definition:
is_defined.h:30
mrpt::is_defined::value
static constexpr bool value
Definition:
is_defined.h:21
Page generated by
Doxygen 1.8.17
for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020