'C++: Copy constructor call using curly braces

Suppose I have the following piece of code where the only things about Type I know are:

  1. Type does not implement constructor with signature Type(std::initializer_list<Type>) i.e. constructor taking an initalizer list consisting of Type elements as its argument
  2. Type does implement default and copy constructors
/*
 all necessary includes
*/

 int main()
{
   Type t{};          //calls default c-tor
   Type t_ref(t);     //Reference case. calls copy c-tor

   Type t1{t};        //Case 1. is there any difference from Reference case?
   Type t2 = Type{t}; //Case 2. is there any difference from Reference case?
   Type t3{Type{t}};  //Case 3. is there any difference from Reference case?
   Type t4 = {t};     //Case 4. is there any difference from Reference case?
}

I know curly braces are used for initializer lists, but I have not found how they behave by the standard in cases shown in the code above.

  1. Can I be 100% sure all four cases behave exactly the same in all possible cases as the Reference case? If not, when and what is the difference?

  2. Are there any drawbacks of using curly brackets over simple brackets when copy constructing an object in C++?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source