MRPT  2.0.4
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
STL namespace.
constexpr bool is_defined_v
Definition: is_defined.h:30
Checks if type is defined (fails for forward declarations).
Definition: is_defined.h:19
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
static constexpr bool value
Definition: is_defined.h:21



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020