Overload resolution

In order to compile a function call, the compiler must first perform name lookup, which, for functions, may involve argument-dependent lookup, and for function templates may be followed by template argument deduction. If these steps produce more than one candidate function, then overload resolution is performed to select the function that will actually be called. In general, the candidate function whose parameters match the arguments most closely is the one that is called. Details Before ove

Other operators

Operator name Syntax Over​load​able Prototype examples (for class T) Inside class definition Outside class definition function call a(a1, a2) Yes R T::operator()(Arg1 &a1, Arg2 &a2, ... ...); N/A comma a, b Yes T2& T::operator,(T2 &b); T2& operator,(const T &a, T2 &b); ternary conditional a ? b : c No N/A N/A Explanation The function call operator provides function semantics for any object. The ternary conditional operator

or_eq

Usage alternative operators: as an alternative for |=

Order of evaluation

Order of evaluation of the operands of almost all C++ operators (including the order of evaluation of function arguments in a function-call expression and the order of evaluation of the subexpressions within any expression) is unspecified. The compiler can evaluate operands in any order, and may choose another order when the same expression is evaluated again. There are several exceptions to this rule (e.g. for the &&, ||, and , operators) which are noted below. Otherwise, there is no c

ostream

This header is part of the Input/output library. Classes basic_ostream wraps a given abstract device (std::basic_streambuf) and provides high-level output interface (class template) std::ostream basic_ostream<char>(typedef) std::wostream basic_ostream<wchar_t>(typedef) Functions operator<<(std::basic_ostream) inserts character data (function template) Manipulators ends outputs '\0' (function template) flush flushes the output stream

operators (std::vector)

template< class T, class Alloc > bool operator==( const vector<T,Alloc>& lhs, const vector<T,Alloc>& rhs ); (1) template< class T, class Alloc > bool operator!=( const vector<T,Alloc>& lhs, const vector<T,Alloc>& rhs ); (2) template< class T, class Alloc > bool operator<( const vector<T,Alloc>& lhs, const vector<T,Alloc>& rhs ); (3) template< c

operators (std::weibull_distribution)

template< class ResultType > bool operator==( const weibull_distribution<ResultType>& lhs, const weibull_distribution<ResultType>& rhs ); (1) template< class ResultType > bool operator!=( const weibull_distribution<ResultType>& lhs, const weibull_distribution<ResultType>& rhs ); (2) Compares two distribution objects. Two distribution objects are equal when parameter values and internal state is t

operators (std::unordered_set)

template< class Key, class Hash, class KeyEqual, class Allocator > bool operator==( const unordered_set<Key,Hash,KeyEqual,Allocator>& lhs, const unordered_set<Key,Hash,KeyEqual,Allocator>& rhs ); (1) template< class Key, class Hash, class KeyEqual, class Allocator > bool operator!=( const unordered_set<Key,Hash,KeyEqual,Allocator>& lhs, const unordered_set<Key,Hash,KeyEqual,Allocator>& rhs ); (2)

operators (std::weibull_distribution)

template< class CharT, class Traits, class ResultType > std::basic_ostream<CharT,Traits>& operator<<( std::basic_ostream<CharT,Traits>& ost, const weibull_distribution<ResultType>& d ); (1) template< class CharT, class Traits, class ResultType > std::basic_istream<CharT,Traits>& operator>>( std::basic_istream<CharT,Traits>& ist,

or

Usage alternative operators: as an alternative for ||