Q:

Is there any way to execute the copy constructor when two user defined copy constructors present?

1= Class_Name( Class_Name& object_name )
2= Class_Name( const Class_Name& object_name )

If both of these copy constructors are defined by user, Then is there any way to execute no(2) copy constructor(Taking copy elision
 concept into consideration )?

A:

Answering your question... copy constructor no (2) can be executed
#include <iostream>

using namespace std;

class Class_Name
{
  public:
  int xx;

  // Copy Constructor No. 1
  Class_Name(Class_Name& objCopy)
  {
      cout << "Copy Constructor No. 1 called" << endl;
  }

  // Copy Constructor No. 2
  Class_Name(const Class_Name& objCopy)
  {
      cout << "Copy Constructor No. 2 called" << endl;        
  }

  Class_Name(int x) : xx(x) {}  /* conversion constructor */
};

int main()
{    
    Class_Name obj1 = 1; // obj1 is not const, 1 is passed "by value", since it's primitive type
    Class_Name objCopy1 = obj1; // obj1 is not const, other is not const, obj1 is passed by const reference

    const Class_Name obj2 = 2; // obj2 is const
    Class_Name objCopy2 = obj2;

    return 0;
}

Output:

Copy Constructor No. 1 called
Copy Constructor No. 2 called

Copy Elision
Class_Name objCopy1 = Class_Name(obj1);

would be same as
Class_Name objCopy1 = obj1;

