mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
If available, use constexpr if
This commit is contained in:
parent
7cf7152993
commit
503d4dd335
@ -867,7 +867,11 @@ namespace dlib
|
||||
|
||||
const auto convert_to_output_type = [](float value)
|
||||
{
|
||||
if (std::is_integral<T>::value)
|
||||
if
|
||||
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
constexpr
|
||||
#endif // __cplusplus >= 201703L
|
||||
(std::is_integral<T>::value)
|
||||
return static_cast<T>(value + 0.5);
|
||||
else
|
||||
return static_cast<T>(value);
|
||||
|
Loading…
Reference in New Issue
Block a user