-
Notifications
You must be signed in to change notification settings - Fork 6
/
declval.hpp
52 lines (37 loc) · 1 KB
/
declval.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @file declval.hpp
* @brief
* @date 2019-11-30
* @author Peter
* @copyright
* Peter of [ThinkSpirit Laboratory](http://thinkspirit.org/)
* of [Nanjing University of Information Science & Technology](http://www.nuist.edu.cn/)
* all rights reserved
*/
#ifndef KERBAL_UTILITY_DECLVAL_HPP
#define KERBAL_UTILITY_DECLVAL_HPP
#include <kerbal/compatibility/noexcept.hpp>
#if __cplusplus >= 201103L
# include <kerbal/type_traits/add_rvalue_reference.hpp>
#else
# include <kerbal/type_traits/add_lvalue_reference.hpp>
#endif
namespace kerbal
{
namespace utility
{
# if __cplusplus >= 201103L
template <typename T>
typename kerbal::type_traits::add_rvalue_reference<T>::type
declval() KERBAL_NOEXCEPT;
# else
template <typename T>
typename kerbal::type_traits::add_lvalue_reference<T>::type
declval() KERBAL_NOEXCEPT;
# endif
template <typename T>
T *
declthis() KERBAL_NOEXCEPT;
} // namespace utility
} // namespace kerbal
#endif // KERBAL_UTILITY_DECLVAL_HPP