Question: Hello in my tableView i added a refresh button to my custom tableViewCell 

[![enter image description here](https://i.stack.imgur.com/H1Fo0.png)](https://i.stack.imgur.com/H1Fo0.png)

because i want to reload the single cell after the button tap, to do it (looking around the net) i created this func 

```
 @IBAction func rowReload(_ sender: Any) {

        let index = IndexPath(row: , section: )
        self.tableView.reloadRows(at: [index], with: .none)
    }

```

but my problem is this line `let index = IndexPath(row: , section: )`, how can i tell to my function that the reload action must take place on the row where i pressed the button? (in simple words, what i have to write next `row:` and `section:` ?)

Answer: 
Focus on what's more readable and which approach provides a better intuition to the reader, and please keep the performance issues you might think that arise in the background.

A function that returns a tuple (or a pair, a struct, etc.) is yelling to the author that the function returns something, that almost always has some meaning that the user can take into account.

A function that gives back the results in variables passed by reference, may slip the eye's attention of a tired reader.

So, in general, prefer to return the results by a tuple.

---

Mike van Dyke pointed to this [link](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-out-multi):

> 
> F.21: To return multiple "out" values, *prefer returning a tuple or struct* 
> 
> 
> Reason
> 
> 
> A return value is self-documenting as an "output-only"
>  value. Note that C++ does have multiple return values, by convention
>  of using a tuple (including pair), possibly with the extra convenience
>  of tie at the call site.
> 
> 
> [...]
> 
> 
> Exception
> 
> 
> Sometimes, we need to pass an object to a function to manipulate its state. In such cases, passing the object by reference `T&` is usually the right technique.
> 
> 
>
What Zang said is true but not up-to the point. I ran the code provided in question with `chrono` to measure time. I think the answer needs to be edited after observing what happened.

For 1M iterations, time taken by function call via reference was 3ms while time taken by function call via `std::tie` combined with `std::tuple` was about 94ms.

Though the difference seems very less in practice, still tuple one will perform slightly slower. Hence, for performance intensive systems, I suggest using call by reference.

My code:

```
#include <iostream>
#include <tuple>
#include <chrono>

std::tuple<int, int> returnValues(const int a, const int b)
{
    return std::tuple<int, int>(a, b);
}

void returnValuesVoid(int &a, int &b)
{
    a += 100;
    b += 100;
}

int main()
{
    int a = 10, b = 20;
    auto begin = std::chrono::high_resolution_clock::now();
    int x, y;
    for (int i = 0; i < 1000000; i++)
    {
        std::tie(x, y) = returnValues(a, b);
    }
    auto end = std::chrono::high_resolution_clock::now();
    std::cout << double(std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count()) << '\n';

    a = 10;
    b = 20;
    auto start = std::chrono::high_resolution_clock::now();
    for (int i = 0; i < 1000000; i++)
    {
        returnValuesVoid(a, b);
    }
    auto stop = std::chrono::high_resolution_clock::now();
    std::cout << double(std::chrono::duration_cast<std::chrono::milliseconds>(stop - start).count()) << '\n';
}

```