operator==,!=,<,<=,>,>=(std::valarray) (3) - Linux Manuals
operator==,!=,<,<=,>,>=(std::valarray): operator==,!=,<,<=,>,>=(std::valarray)
NAME
operator==,!=,<,<=,>,>=(std::valarray) - operator==,!=,<,<=,>,>=(std::valarray)
Synopsis
template< class T >
std::valarray<bool> operator==( const std::valarray<T>& lhs, const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator!=( const std::valarray<T>& lhs, const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator<( const std::valarray<T>& lhs, const std::valarray<T>& rhs ); (1)
template< class T >
std::valarray<bool> operator<=( const std::valarray<T>& lhs, const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator>( const std::valarray<T>& lhs, const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator>=( const std::valarray<T>& lhs, const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator==( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator!=( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator< ( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs ); (2)
template< class T >
std::valarray<bool> operator<=( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator> ( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator>=( const typename std::valarray<T>::value_type & lhsv,
const std::valarray<T>& rhs );
template< class T >
std::valarray<bool> operator==( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv );
template< class T >
std::valarray<bool> operator!=( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv );
template< class T >
std::valarray<bool> operator< ( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv ); (3)
template< class T >
std::valarray<bool> operator<=( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv );
template< class T >
std::valarray<bool> operator> ( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv );
template< class T >
std::valarray<bool> operator>=( const std::valarray<T>& lhs,
const typename std::valarray<T>::value_type & rhsv );
Compares each value within the numeric array with another value.
1) Returns a numeric array of bool containing elements each of which is obtained by applying the indicated comparison operator to the corresponding values of lhs and rhs
The behavior is undefined if size() != v.size()
2) Returns a numeric array of bool containing elements each of which is obtained by applying the indicated comparison operator to lhsv and the corresponding value of rhs .
3) Returns a numeric array of bool containing elements each of which is obtained by applying the indicated comparison operator to the corresponding value of lhs and rhsv.
Parameters
lhs, rhs - numeric arrays to compare
lhsv, rhsv - values to compare to each element within a numeric array
Return value
A numeric array of bool containing comparison results of corresponding elements.
Exceptions
(none)
Notes
Each of the operators can only be instantiated if the following requirements are met:
The function can be implemented with the return type different from std::valarray. In this case, the replacement type has the following properties:
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
LWG_3074 C++98 T is deduced from both the scalar and the valarray for (2-3), disallowing mixed-type calls only deduce T from the valarray
Example
// Run this code
Output: