MRPT  2.0.1
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.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020