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: 
Using another compiler (VS 2017) the resulting code shows no difference, as the function calls are just optimized away.

```
int main() {
00007FF6A9C51E50  sub         rsp,28h  
    auto [x,y] = returnValues(10,20);

    std::cout << x ;
00007FF6A9C51E54  mov         edx,0Ah  
00007FF6A9C51E59  call        std::basic_ostream<char,std::char_traits<char> >::operator<< (07FF6A9C51F60h)  
    std::cout << y ;
00007FF6A9C51E5E  mov         edx,14h  
00007FF6A9C51E63  call        std::basic_ostream<char,std::char_traits<char> >::operator<< (07FF6A9C51F60h)  

    int a = 10, b = 20;
    returnValuesVoid(a, b);

    std::cout << a ;
00007FF6A9C51E68  mov         edx,6Eh  
00007FF6A9C51E6D  call        std::basic_ostream<char,std::char_traits<char> >::operator<< (07FF6A9C51F60h)  
    std::cout << b ;
00007FF6A9C51E72  mov         edx,78h  
00007FF6A9C51E77  call        std::basic_ostream<char,std::char_traits<char> >::operator<< (07FF6A9C51F60h)  
}
00007FF6A9C51E7C  xor         eax,eax  
00007FF6A9C51E7E  add         rsp,28h  
00007FF6A9C51E82  ret  

```

So using clearer code seems to be the obvious choice.
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';
}

```