Skip to content

Commit

Permalink
Use = default for skeleton copy constructor
Browse files Browse the repository at this point in the history
But only when `ACE_HAS_CPP11` is defined. This is a sort of backport of
DOCGroup#2309.
  • Loading branch information
iguessthislldo committed Jan 10, 2025
1 parent ca8a80c commit a2d38e2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
7 changes: 6 additions & 1 deletion TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ be_visitor_interface_ih::visit_interface (be_interface *node)
<< be_global->impl_class_prefix () << namebuf
<< be_global->impl_class_suffix () << " (const "
<< be_global->impl_class_prefix () << namebuf
<< be_global->impl_class_suffix () << "&);" <<be_nl <<be_nl;
<< be_global->impl_class_suffix () << "&)\n"
<< "#ifdef ACE_HAS_CPP11" << be_idt_nl
<< "= default\n"
<< "#endif" << be_uidt_nl
<< ";" << be_nl
<< be_nl;
}

if (be_global->gen_assign_op ())
Expand Down
6 changes: 4 additions & 2 deletions TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ be_visitor_interface_is::visit_interface (be_interface *node)

if (be_global->gen_copy_ctor () && !node->is_local ())
{
*os << "//Implementation Skeleton Copy Constructor" << be_nl;
*os << "//Implementation Skeleton Copy Constructor\n"
<< "#ifndef ACE_HAS_CPP11" << be_nl;

*os << be_global->impl_class_prefix () << node->flat_name ()
<< be_global->impl_class_suffix () <<"::"
Expand Down Expand Up @@ -105,7 +106,8 @@ be_visitor_interface_is::visit_interface (be_interface *node)

*os << be_uidt_nl
<< "{" << be_nl
<< "}" << be_nl << be_uidt_nl;
<< "}\n"
<< "#endif" << be_nl << be_uidt_nl;
}

if (be_global->gen_assign_op ())
Expand Down
6 changes: 5 additions & 1 deletion TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node)

// Copy constructor and destructor.
*os << class_name.c_str () << " (const "
<< class_name.c_str () << "& rhs);" << be_nl
<< class_name.c_str () << "& rhs)\n"
<< "#ifdef ACE_HAS_CPP11" << be_idt_nl
<< "= default\n"
<< "#endif" << be_uidt_nl
<< ";" << be_nl
<< "virtual ~" << class_name.c_str () << " (void);" << be_nl_2;

// _is_a
Expand Down
8 changes: 5 additions & 3 deletions TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
*os << "{" << be_idt_nl
<< "this->optable_ = &tao_" << flat_name
<< "_optable;" << be_uidt_nl
<< "}" << be_nl_2;
<< "}\n\n";

// find if we are at the top scope or inside some module
*os << full_skel_name << "::"
*os << "#ifndef ACE_HAS_CPP11" << be_nl
<< full_skel_name << "::"
<< local_name_prefix << node_local_name << " ("
<< "const " << local_name_prefix
<< node_local_name << " &"
Expand All @@ -150,7 +151,8 @@ be_visitor_interface_ss::visit_interface (be_interface *node)

*os << be_uidt_nl
<< "{" << be_nl
<< "}" << be_nl_2;
<< "}\n"
<< "#endif" << be_nl_2;

*os << full_skel_name << "::~"
<< local_name_prefix << node_local_name
Expand Down

0 comments on commit a2d38e2

Please sign in to comment.