Less_result<T>

Consider the following function template predicates:

1
2
3
4
5
6
  /// the result of evaluating type T's less than operator
  Less_result<T>

  /// indicates if the result of evaluating type T's less than operator
  /// is Boolean or not
  Boolean<Less_result<T>>


The second predicate can be declared as returning a bool.

What would the declaration of the 1st predicate be? Ie, what is its return type?

Thanks.
Assuming that the less than operator is const-correct:

1
2
3
4
#include <utility>

template < typename T >
using less_result = decltype( std::declval<T>() < std::declval<T>() ) ;
Topic archived. No new replies allowed.