use _v prefixed version

This commit is contained in:
Sébastien Loriot 2022-05-06 14:52:32 +02:00
parent a186d5205e
commit 79f9d82389
2 changed files with 13 additions and 4 deletions

View File

@ -325,9 +325,12 @@ public:
static const bool value = (sizeof(f<T>(0)) == sizeof(char)); static const bool value = (sizeof(f<T>(0)) == sizeof(char));
}; };
template <class T>
CGAL_CPP17_INLINE constexpr bool Has_member_report_v = Has_member_report<T>::value;
template <typename Callback> template <typename Callback>
inline inline
std::enable_if_t<Has_member_report<Callback>::value, bool> std::enable_if_t<Has_member_report_v<Callback>, bool>
report_impl(Callback callback, int dim) report_impl(Callback callback, int dim)
{ {
return callback.report(dim); return callback.report(dim);
@ -335,7 +338,7 @@ report_impl(Callback callback, int dim)
template <typename Callback> template <typename Callback>
inline inline
std::enable_if_t<!Has_member_report<Callback>::value, bool> std::enable_if_t<!Has_member_report_v<Callback>, bool>
report_impl(const Callback&, int) report_impl(const Callback&, int)
{ {
return false; return false;
@ -343,7 +346,7 @@ report_impl(const Callback&, int)
template <typename Callback> template <typename Callback>
inline inline
std::enable_if_t<Has_member_report<Callback>::value, void> std::enable_if_t<Has_member_report_v<Callback>, void>
progress_impl(Callback callback, double d) progress_impl(Callback callback, double d)
{ {
callback.progress(d); callback.progress(d);
@ -351,7 +354,7 @@ progress_impl(Callback callback, double d)
template <typename Callback> template <typename Callback>
inline inline
std::enable_if_t<!Has_member_report<Callback>::value, void> std::enable_if_t<!Has_member_report_v<Callback>, void>
progress_impl(const Callback&, double) progress_impl(const Callback&, double)
{} {}

View File

@ -499,6 +499,12 @@ namespace cpp11{
# define CGAL_FALLTHROUGH while(false){} # define CGAL_FALLTHROUGH while(false){}
#endif #endif
#if CGAL_CXX17
# define CGAL_CPP17_INLINE inline
#else
# define CGAL_CPP17_INLINE
#endif
#ifndef CGAL_NO_ASSERTIONS #ifndef CGAL_NO_ASSERTIONS
# define CGAL_NO_ASSERTIONS_BOOL false # define CGAL_NO_ASSERTIONS_BOOL false
#else #else