VCCC  2024.05
VisualCamp Common C++ library
nodiscard.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/04.
3 //
4 
5 #ifndef VCCC_CORE_NODISCARD_HPP
6 #define VCCC_CORE_NODISCARD_HPP
7 
8 #if __cplusplus < 201703L
9 # if defined(__GNUC__) && (__GNUC__ >= 4)
10 # define VCCC_NODISCARD __attribute__ ((warn_unused_result))
11 # elif defined(_MSC_VER) && (_MSC_VER >= 1700)
12 # define VCCC_NODISCARD _Check_return_
13 # else
14 # define VCCC_NODISCARD
15 # endif
16 #else
17 # define VCCC_NODISCARD [[nodiscard]]
18 #endif
19 
20 #endif // VCCC_CORE_CONSTEXPR_HPP