VisualStudio 2008 (VC++ 9)
Problem with overloading operator()

Hello community!

It seems that overloaded version of operator() must all differ in their argument list, independly of the return type.

I have the following case:

```
class Sha256{
public:
   QVector<quint32> operator()(QString const& data);      
   QByteArray operator()(QByteArray const& data);
   QVector<quint32> operator()(QByteArray const& data);   // this is line 168   
   ...
}

```

Last declaration leads to following compilation error:
.\sha256.cpp(168) : error C2556: 'QVector Sha256::operator ()(const QByteArray &)' : overloaded function differs only by return type from 'QByteArray Sha256::operator ()(const QByteArray &)'
 with
 [
 T=uint
 ]

On the other side, following declarations are working:

```
class Sha256{
public:
   QVector<quint32> operator()(QString const& data);
   QByteArray operator()(QByteArray const& data);
   ...
}

```

because they have different arguments.

One way would be to add in the first case an additional argument like 

```
QByteArray<quint32> operator()(QByteArray const& data, bool getByteArray)

```

but this is embarassing, not intuitive and also not clean (return type would be a QByteArray, independly of the value of getByteArray, even in case of false!).

Another way could be to use a template function like

```
template<class T> T operator()(QByteArray const& ba)
template<class T> T operator()(QString const& str) 

```

but T could only be of a few 'supported' type (QByteArray and QVector), therefore user could run into trouble if using wrong T Type. This version seems to be error prone.

So my questions are:
1. Why is the return type of function objects not taken into account in the signature to distinguish between different flavors of the function like in 'classical' functions?
2. Is there a better way around than adding an additional dummy argument?

Thank you for your valuable time.
Alain