Question: from time to time it happens that I want to change a type I defines via **using** by a real class.

For example I here a sample, how I can use a struct the same way as a type:

```
using t_int_pair = std::pair< int, int >;
struct s_int_pair : public std::pair< int, int >
{
    using std::pair< int, int >::pair; // inherit ctor
};

void foo()
{
    auto [a1, a2] = t_int_pair{ 0, 0 };
    auto [b1, b2] = s_int_pair{ 0, 0 };
    // ...
}

```

This works fine.

But: for any reason the same code doesn't work for std::tuple, i.e. this produces a compile error:

```
using t_int_triple = std::tuple< int, int, int >;
struct s_int_triple : public std::tuple< int, int, int >
{
    using std::tuple< int, int, int >::tuple; // inherit ctor
};

void bar()
{
    auto [a1, a2, a3] = t_int_triple{ 0, 0, 0 };
    auto [b1, b2, b3] = s_int_triple{ 0, 0, 0 }; // ERROR: cannot decompose class type 'std::_Tuple_impl<0, int, int>'
    // ...
}

```

Does anyone know, why this happens?

And is there a way to workaround this?

I tested this on Compiler Explorer with clang, gcc and msvc.

Any help is appreciated,

regards,

Zoppo

Answer: 
[![params](https://i.stack.imgur.com/EFt1v.png)](https://i.stack.imgur.com/EFt1v.png)

If you are talking about stuff in picture, simple answer is it does not matter at all. In "pass by value" case, value of caller function is copied to the address of parameter of called function.

When it comes to references, here is one quote:

> 
> A reference shares the same memory address with the original variable but also takes up some space on the stack whereas a pointer has its own memory address and size on the stack.
> 
> 
> 

So to simplify the answer, parameter and local variable names do not matter much because compiler converts them into addresses. As seen from above, even reference has to store the address of referred variable.

My suggestion is [read this](https://www.learncpp.com/cpp-tutorial/passing-arguments-by-value/). And think of variables or parameters in term of addresses, not in terms of their names.
Assuming the example:

```
void foo(int& arg1, int arg2)
{
}

void bar()
{
    int   arg1 = 4;
    int   arg2 = 2;
    foo(arg1, arg2);
}

```

No, such code will not cause any problem. The scopes of those variables are disjoint, none of them can potentially hide another (or did you mean some other potential problem?).