Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of the ==<> operator?

Tags:

Looking into some code of a colleague of mine, I came accross the following:

friend bool operator==<>(ValueIter<Type> const &rhs, ValueIter<Type> const &lhs);

It is declared in a template class:

template<typename Type>
class ValueIter: public std::iterator<std::bidirectional_iterator_tag, Type>

Can someone tell me what the ==<> symbol indicates? I expect it has something to with the != operator.

like image 517
Albert Schrotenboer Avatar asked Aug 06 '15 12:08

Albert Schrotenboer


People also ask

What is an example of an operator?

The definition of an operator is someone who controls a machine, or the manager or owner of a business. An example of an operator is a person who controls a telephone switchboard. An example of an operator is someone who controls a crane at a loading dock.

What is called a operator?

An operator is a person who connects phone calls at a telephone exchange or in a place such as an office or hotel. He dialled the operator and put in a call for Rome. 2. countable noun [usually noun NOUN] An operator is a person who is employed to operate or control a machine.

What does operator company mean?

an agent that operates some apparatus or machine.


2 Answers

It looks like two, the operator== that is a full template instantiation or specialisation <>.

I've seen only a few like this in the wild though.

Given the friend, the class is probably befriending the template operator.


If you are getting linker errors with it, see this answer for why.

like image 184
Niall Avatar answered Sep 20 '22 17:09

Niall


Your question is incomplete.

Presumably, in some context within the code you are examining, there is a templated operator==() function.

Then within some class, a particular specialisation of that templated operator==() is being declared as a friend.

Without context that you haven't given (i.e. of the preceding template definition, or of the enclosing class definition) it is not possible to give a more specific answer. There are too many possibilities for what the template or relevant specialisations are.

like image 37
Peter Avatar answered Sep 21 '22 17:09

Peter