Issue 17420: In-place construction of structure types (idl2cpp11-rtf) Source: Real-Time Innovations (Dr. Sumant Tambe, sumant(at)rti.com) Nature: Enhancement Severity: Significant Summary: There are two main motivations: (1) Performance: IDL types may be large and not all IDL types may have C++11 mapping with efficient move constructors. For example, an IDL structure containing an array does not have an efficient move-ctor. Current mapping for an IDL struct type (section 6.13.1) requires an explicit constructor accepting values for each member by value in the order they are specified in IDL. Although this method is sufficient in most cases, it is not optimal. Particularly, the types that don't support efficient move-ctor. (2) Usability: Often C++11 standard library containers could be constructed using several alternatives. For instance, a string member in a struct may be constructed using any of its 9 constructors or a vector may be constructed using any of its 7 constructors. Currently, the IDL2C++11 specification allows construction of members of a structure using only two kinds of constructors: copy-ctor and move-ctor. (due to the pass-by-value rule mentioned above) Resolution: The IDL2C++11 mapping of structures could be enhanced to construct large objects in-place. Provide a way to construct the member objects of a struct in-place using a perfect-forwarding constructor. The intent is to support all the ways of constructing all the member objects from the constructor of the parent object. Moreover, a perfect-forwarding constructor may eliminate the need for a move, which may lead to some performance improvements. The solution relies on an idiom known as piecewise_construct idiom. It relies on a perfect-forwarding constructor that takes as many tuples as there are members in a struct. Each tuple encapsulates the parameters to construct one member. Tuples are needed because member ctor could take several parameters and the user may be interested in using them. For instance, using an allocator for std::vector. The user of the struct calls std::forward_as_tuple for each member object to group the parameters in a tuple. The special constructor simply forwards the tuples to the respective member. The C++ standard library uses this idiom for std::map and std::unordered_map to construct complex objects in-place using the emplace operations. However, more general uses have been identified: http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of-parameter-groups.html Resolution: The issues proposes an extension to the construction of structured types. A vendor could already add this as performance improvement without being it as part of the specification. Before adding this to the specification this addition first have to be shown in a concrete product to make sure it can be implemented and is usable for users. This hasn’t been done by any vendor yet which made us decide to defer this issue to a future RTF. Revised Text: Disposition: Deferred Revised Text: Actions taken: June 11, 2012: received issue Discussion: The issues proposes an extension to the construction of structured types. A vendor could already add this as performance improvement without being it as part of the specification. Before adding this to the specification this addition first have to be shown in a concrete product to make sure it is implementable and usable for users. This hasn’t been done by any vendor yet which made us decide to defer this issue to a future RTF. End of Annotations:===== m: webmaster@omg.org Date: 11 Jun 2012 02:10:55 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: IDL to C++11 Language Mapping (IDL2C++11) Section: 6.13.1 FormalNumber: ptc/12-04-03 Version: FTF - Beta 1 Doc_Year: 2012 Doc_Month: April Doc_Day: 01 Page: 14 Title: In-place construction of structure types Nature: Enhancement Severity: Significant CODE: 3TMw8 B1: Report Issue Description: There are two main motivations: (1) Performance: IDL types may be large and not all IDL types may have C++11 mapping with efficient move constructors. For example, an IDL structure containing an array does not have an efficient move-ctor. Current mapping for an IDL struct type (section 6.13.1) requires an explicit constructor accepting values for each member by value in the order they are specified in IDL. Although this method is sufficient in most cases, it is not optimal. Particularly, the types that don't support efficient move-ctor. (2) Usability: Often C++11 standard library containers could be constructed using several alternatives. For instance, a string member in a struct may be constructed using any of its 9 constructors or a vector may be constructed using any of its 7 constructors. Currently, the IDL2C++11 specification allows construction of members of a structure using only two kinds of constructors: copy-ctor and move-ctor. (due to the pass-by-value rule mentioned above) Resolution: The IDL2C++11 mapping of structures could be enhanced to construct large objects in-place. Provide a way to construct the member objects of a struct in-place using a perfect-forwarding constructor. The intent is to support all the ways of constructing all the member objects from the constructor of the parent object. Moreover, a perfect-forwarding constructor may eliminate the need for a move, which may lead to some performance improvements. The solution relies on an idiom known as piecewise_construct idiom. It relies on a perfect-forwarding constructor that takes as many tuples as there are members in a struct. Each tuple encapsulates the parameters to construct one member. Tuples are needed because member ctor could take several parameters and the user may be interested in using them. For instance, using an allocator for std::vector. The user of the struct calls std::forward_as_tuple for each member object to group the parameters in a tuple. The special constructor simply forwards the tuples to the respective member. The C++ standard library uses this idiom for std::map and std::unordered_map to construct complex objects in-place using the emplace operations. However, more general uses have been identified: http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of-parameter-groups.html X-Virus-Scanned: by XS4ALL Virus Scanner Date: Mon, 11 Jun 2012 20:39:54 +0200 From: Johnny Willemsen Reply-To: jwillemsen@remedy.nl Organization: Remedy IT User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 To: Sumant Tambe CC: idl2cpp11-ftf@omg.org Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi Sumant, Given the fact that you have posted more about this topic and have the concrete experience, could you maybe write a concrete proposal section which can be added to the spec? Johnny On 06/11/2012 08:28 PM, Juergen Boldt wrote: From: webmaster@omg.org Date: 11 Jun 2012 02:10:55 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: IDL to C++11 Language Mapping (IDL2C++11) Section: 6.13.1 FormalNumber: ptc/12-04-03 Version: FTF - Beta 1 Doc_Year: 2012 Doc_Month: April Doc_Day: 01 Page: 14 Title: In-place construction of structure types Nature: Enhancement Severity: Significant CODE: 3TMw8 B1: Report Issue Description: There are two main motivations: (1) Performance: IDL types may be large and not all IDL types may have C++11 mapping with efficient move constructors. For example, an IDL structure containing an array does not have an efficient move-ctor. Current mapping for an IDL struct type (section 6.13.1) requires an explicit constructor accepting values for each member by value in the order they are specified in IDL. Although this method is sufficient in most cases, it is not optimal. Particularly, the types that don't support efficient move-ctor. (2) Usability: Often C++11 standard library containers could be constructed using several alternatives. For instance, a string member in a struct may be constructed using any of its 9 constructors or a vector may be constructed using any of its 7 constructors. Currently, the IDL2C++11 specification allows construction of members of a structure using only two kinds of constructors: copy-ctor and move-ctor. (due to the pass-by-value rule mentioned above) Resolution: The IDL2C++11 mapping of structures could be enhanced to construct large objects in-place. Provide a way to construct the member objects of a struct in-place using a perfect-forwarding constructor. The intent is to support all the ways of constructing all the member objects from the constructor of the parent object. Moreover, a perfect-forwarding constructor may eliminate the need for a move, which may lead to some performance improvements. The solution relies on an idiom known as piecewise_construct idiom. It relies on a perfect-forwarding constructor that takes as many tuples as there are members in a struct. Each tuple encapsulates the parameters to construct one member. Tuples are needed because member ctor could take several parameters and the user may be interested in using them. For instance, using an allocator for std::vector. The user of the struct calls std::forward_as_tuple for each member object to group the parameters in a tuple. The special constructor simply forwards the tuples to the respective member. The C++ standard library uses this idiom for std::map and std::unordered_map to construct complex objects in-place using the emplace operations. However, more general uses have been identified: http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of-parameter-groups.html Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org [] X-Virus-Scanned: by XS4ALL Virus Scanner Date: Tue, 12 Jun 2012 19:59:51 +0200 From: Johnny Willemsen Reply-To: jwillemsen@remedy.nl Organization: Remedy IT User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 To: Sumant Tambe CC: "idl2cpp11-ftf@omg.org" Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi, Maybe you can take on of the headers we post on osportal.remedy.nl and extend it with the method you think we should add? Than we can easily prototype this in our product and see if we don't miss anything. Johnny On 06/11/2012 09:21 PM, Sumant Tambe wrote: Ok. I'll take a shot at it. Will you attend the OMG tech meeting in Boston? May be I'll have it by then and you can review it at that time. Sumant Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com -----Original Message----- From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] Sent: Monday, June 11, 2012 11:40 AM To: Sumant Tambe Cc: idl2cpp11-ftf@omg.org Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi Sumant, Given the fact that you have posted more about this topic and have the concrete experience, could you maybe write a concrete proposal section which can be added to the spec? Johnny On 06/11/2012 08:28 PM, Juergen Boldt wrote: From: webmaster@omg.org Date: 11 Jun 2012 02:10:55 -0400 To: Subject: Issue/Bug Report ********************************************************** *********** ********** Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: IDL to C++11 Language Mapping (IDL2C++11) Section: 6.13.1 FormalNumber: ptc/12-04-03 Version: FTF - Beta 1 Doc_Year: 2012 Doc_Month: April Doc_Day: 01 Page: 14 Title: In-place construction of structure types Nature: Enhancement Severity: Significant CODE: 3TMw8 B1: Report Issue Description: There are two main motivations: (1) Performance: IDL types may be large and not all IDL types may have C++11 mapping with efficient move constructors. For example, an IDL structure containing an array does not have an efficient move-ctor. Current mapping for an IDL struct type (section 6.13.1) requires an explicit constructor accepting values for each member by value in the order they are specified in IDL. Although this method is sufficient in most cases, it is not optimal. Particularly, the types that don't support efficient move-ctor. (2) Usability: Often C++11 standard library containers could be constructed using several alternatives. For instance, a string member in a struct may be constructed using any of its 9 constructors or a vector may be constructed using any of its 7 constructors. Currently, the IDL2C++11 specification allows construction of members of a structure using only two kinds of constructors: copy-ctor and move-ctor. (due to the pass-by-value rule mentioned above) Resolution: The IDL2C++11 mapping of structures could be enhanced to construct large objects in-place. Provide a way to construct the member objects of a struct in-place using a perfect-forwarding constructor. The intent is to support all the ways of constructing all the member objects from the constructor of the parent object. Moreover, a perfect-forwarding constructor may eliminate the need for a move, which may lead to some performance improvements. The solution relies on an idiom known as piecewise_construct idiom. It relies on a perfect-forwarding constructor that takes as many tuples as there are members in a struct. Each tuple encapsulates the parameters to construct one member. Tuples are needed because member ctor could take several parameters and the user may be interested in using them. For instance, using an allocator for std::vector. The user of the struct calls std::forward_as_tuple for each member object to group the parameters in a tuple. The special constructor simply forwards the tuples to the respective member. The C++ standard library uses this idiom for std::map and std::unordered_map to construct complex objects in-place using the emplace operations. However, more general uses have been identified: http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- parameter -groups.html Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org [] X-Virus-Scanned: amavisd-new at rti.com From: Sumant Tambe To: "jwillemsen@remedy.nl" CC: "idl2cpp11-ftf@omg.org" Date: Tue, 12 Jun 2012 11:52:09 -0700 Subject: RE: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Topic: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Index: Ac1IxS8p4Q2VPOe0Scq9uxMlieZrSQAA8vHQ Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-MIME-Autoconverted: from base64 to 8bit by amethyst.omg.org id q5CIqI65016835 Hi Johnny, That's much better! I think it's better to experiment with this proposed feature a little more so that we've the confidence that it works on all important platforms. VS2011 does not have variadic templates support, therefore, I'm expecting some workarounds for that platform. This will also help formalize the requirement so that different platforms can implement it differently. I'm not sure what headers you are referring to on osportal.remedy.nl. Will it be easier if I check code into the git repository you have? Regards, Sumant Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com > -----Original Message----- > From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > Sent: Tuesday, June 12, 2012 11:00 AM > To: Sumant Tambe > Cc: idl2cpp11-ftf@omg.org > Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) > FTF issue > > Hi, > > Maybe you can take on of the headers we post on osportal.remedy.nl and > extend it with the method you think we should add? Than we can easily > prototype this in our product and see if we don't miss anything. > > Johnny > > On 06/11/2012 09:21 PM, Sumant Tambe wrote: > > Ok. I'll take a shot at it. > > Will you attend the OMG tech meeting in Boston? > > May be I'll have it by then and you can review it at that time. > > > > Sumant > > > > Sumant Tambe, Ph.D. > > Software Research Engineer > > 408.990.7429 > > sumant@rti.com > > www.rti.com > > > >> -----Original Message----- > >> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >> Sent: Monday, June 11, 2012 11:40 AM > >> To: Sumant Tambe > >> Cc: idl2cpp11-ftf@omg.org > >> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > (IDL2C++11) > >> FTF issue > >> > >> Hi Sumant, > >> > >> Given the fact that you have posted more about this topic and have > >> the concrete experience, could you maybe write a concrete proposal > >> section which can be added to the spec? > >> > >> Johnny > >> > >> On 06/11/2012 08:28 PM, Juergen Boldt wrote: > >>> > >>>> From: webmaster@omg.org > >>>> Date: 11 Jun 2012 02:10:55 -0400 > >>>> To: > >>>> Subject: Issue/Bug Report > >>>> > >>>> > >> ********************************************************** > >> *********** > >>>> ********** > >>>> Name: Sumant Tambe > >>>> Employer: Real-Time Innovations > >>>> mailFrom: sumant@rti.com > >>>> Terms_Agreement: I agree > >>>> Specification: IDL to C++11 Language Mapping (IDL2C++11) > >>>> Section: 6.13.1 > >>>> FormalNumber: ptc/12-04-03 > >>>> Version: FTF - Beta 1 > >>>> Doc_Year: 2012 > >>>> Doc_Month: April > >>>> Doc_Day: 01 > >>>> Page: 14 > >>>> Title: In-place construction of structure types > >>>> Nature: Enhancement > >>>> Severity: Significant > >>>> CODE: 3TMw8 > >>>> B1: Report Issue > >>>> > >>>> Description: > >>>> > >>>> There are two main motivations: > >>>> > >>>> (1) Performance: IDL types may be large and not all IDL types may > >>>> have > >>>> C++11 mapping with efficient move constructors. For example, an > IDL > >>>> structure containing an array does not have an efficient move- > ctor. > >>>> Current mapping for an IDL struct type (section 6.13.1) requires > an > >>>> explicit constructor accepting values for each member by value in > >>>> the order they are specified in IDL. Although this method is > >>>> sufficient in most cases, it is not optimal. Particularly, the > >>>> types that don't support efficient move-ctor. > >>>> > >>>> (2) Usability: Often C++11 standard library containers could be > >>>> constructed using several alternatives. For instance, a string > >>>> member in a struct may be constructed using any of its 9 > >>>> constructors or a vector may be constructed using any of its 7 > >>>> constructors. Currently, the IDL2C++11 specification allows > >>>> construction of members of a structure using only two kinds of > >>>> constructors: copy-ctor and move-ctor. (due to the pass-by-value > >>>> rule mentioned above) > >>>> > >>>> Resolution: The IDL2C++11 mapping of structures could be enhanced > >>>> to construct large objects in-place. Provide a way to construct > the > >>>> member objects of a struct in-place using a perfect-forwarding > >>>> constructor. The intent is to support all the ways of constructing > >>>> all the member objects from the constructor of the parent object. > >>>> Moreover, a perfect-forwarding constructor may eliminate the need > >>>> for a move, which may lead to some performance improvements. > >>>> > >>>> The solution relies on an idiom known as piecewise_construct > idiom. > >>>> It relies on a perfect-forwarding constructor that takes as many > >>>> tuples as there are members in a struct. Each tuple encapsulates > >>>> the parameters to construct one member. Tuples are needed because > >> member > >>>> ctor could take several parameters and the user may be interested > >>>> in using them. For instance, using an allocator for std::vector. > >>>> The user of the struct calls std::forward_as_tuple for each member > >>>> object to group the parameters in a tuple. The special constructor > >>>> simply forwards the tuples to the respective member. > >>>> > >>>> The C++ standard library uses this idiom for std::map and > >>>> std::unordered_map to construct complex objects in-place using the > >>>> emplace operations. However, more general uses have been > identified: > >>>> http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- > >> parameter > >>>> -groups.html > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> Juergen Boldt > >>> Director, Member Services > >>> 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA > >>> > >>> Tel: 781 444 0404 x 132 > >>> fax: 781 444 0320 > >>> > >>> www.omg.org > >>> > >>> [] > > > >X-Virus-Scanned: by XS4ALL Virus Scanner Date: Tue, 12 Jun 2012 20:54:30 +0200 From: Johnny Willemsen Reply-To: jwillemsen@remedy.nl Organization: Remedy IT User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 To: Sumant Tambe CC: "idl2cpp11-ftf@omg.org" Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi, I'm not sure what headers you are referring to on osportal.remedy.nl. Will it be easier if I check code into the git repository you have? One of the examples listed at the link below, this are just the generated headers with inline code, not the full product. If you can show with one of the examples what you would like to add, it will make things probably much more clear Johnny https://osportal.remedy.nl/projects/idl2cppx0/repository/revisions/master/show/examples Regards, Sumant Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com -----Original Message----- From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] Sent: Tuesday, June 12, 2012 11:00 AM To: Sumant Tambe Cc: idl2cpp11-ftf@omg.org Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi, Maybe you can take on of the headers we post on osportal.remedy.nl and extend it with the method you think we should add? Than we can easily prototype this in our product and see if we don't miss anything. Johnny On 06/11/2012 09:21 PM, Sumant Tambe wrote: Ok. I'll take a shot at it. Will you attend the OMG tech meeting in Boston? May be I'll have it by then and you can review it at that time. Sumant Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com -----Original Message----- From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] Sent: Monday, June 11, 2012 11:40 AM To: Sumant Tambe Cc: idl2cpp11-ftf@omg.org Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Hi Sumant, Given the fact that you have posted more about this topic and have the concrete experience, could you maybe write a concrete proposal section which can be added to the spec? Johnny On 06/11/2012 08:28 PM, Juergen Boldt wrote: From: webmaster@omg.org Date: 11 Jun 2012 02:10:55 -0400 To: Subject: Issue/Bug Report ********************************************************** *********** ********** Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: IDL to C++11 Language Mapping (IDL2C++11) Section: 6.13.1 FormalNumber: ptc/12-04-03 Version: FTF - Beta 1 Doc_Year: 2012 Doc_Month: April Doc_Day: 01 Page: 14 Title: In-place construction of structure types Nature: Enhancement Severity: Significant CODE: 3TMw8 B1: Report Issue Description: There are two main motivations: (1) Performance: IDL types may be large and not all IDL types may have C++11 mapping with efficient move constructors. For example, an IDL structure containing an array does not have an efficient move- ctor. Current mapping for an IDL struct type (section 6.13.1) requires an explicit constructor accepting values for each member by value in the order they are specified in IDL. Although this method is sufficient in most cases, it is not optimal. Particularly, the types that don't support efficient move-ctor. (2) Usability: Often C++11 standard library containers could be constructed using several alternatives. For instance, a string member in a struct may be constructed using any of its 9 constructors or a vector may be constructed using any of its 7 constructors. Currently, the IDL2C++11 specification allows construction of members of a structure using only two kinds of constructors: copy-ctor and move-ctor. (due to the pass-by-value rule mentioned above) Resolution: The IDL2C++11 mapping of structures could be enhanced to construct large objects in-place. Provide a way to construct the member objects of a struct in-place using a perfect-forwarding constructor. The intent is to support all the ways of constructing all the member objects from the constructor of the parent object. Moreover, a perfect-forwarding constructor may eliminate the need for a move, which may lead to some performance improvements. The solution relies on an idiom known as piecewise_construct idiom. It relies on a perfect-forwarding constructor that takes as many tuples as there are members in a struct. Each tuple encapsulates the parameters to construct one member. Tuples are needed because member ctor could take several parameters and the user may be interested in using them. For instance, using an allocator for std::vector. The user of the struct calls std::forward_as_tuple for each member object to group the parameters in a tuple. The special constructor simply forwards the tuples to the respective member. The C++ standard library uses this idiom for std::map and std::unordered_map to construct complex objects in-place using the emplace operations. However, more general uses have been identified: http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- parameter -groups.html Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org [] X-Virus-Scanned: amavisd-new at rti.com From: Sumant Tambe To: "jwillemsen@remedy.nl" CC: "idl2cpp11-ftf@omg.org" Date: Tue, 12 Jun 2012 12:45:30 -0700 Subject: RE: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Topic: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Index: Ac1IzNF41murMQ6ESJeuXAk4sORYsQABjEWg Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US I extended the Variable class in testC.h. I got rid of most of the clutter because I don't have TAO for C++11. The attached file focuses only on the proposed addition. It seems to work on gcc4.7+ and clang3.2. Let me know if you have any questions. Sumant Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com > -----Original Message----- > From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > Sent: Tuesday, June 12, 2012 11:55 AM > To: Sumant Tambe > Cc: idl2cpp11-ftf@omg.org > Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) > FTF issue > > Hi, > > > I'm not sure what headers you are referring to on osportal.remedy.nl. > Will it be easier if I check code into the git repository you have? > > One of the examples listed at the link below, this are just the > generated headers with inline code, not the full product. If you can > show with one of the examples what you would like to add, it will make > things probably much more clear > > Johnny > > https://osportal.remedy.nl/projects/idl2cppx0/repository/revisions/mast > er/show/examples > > > > Regards, > > Sumant > > > > Sumant Tambe, Ph.D. > > Software Research Engineer > > 408.990.7429 > > sumant@rti.com > > www.rti.com > > > >> -----Original Message----- > >> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >> Sent: Tuesday, June 12, 2012 11:00 AM > >> To: Sumant Tambe > >> Cc: idl2cpp11-ftf@omg.org > >> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > (IDL2C++11) > >> FTF issue > >> > >> Hi, > >> > >> Maybe you can take on of the headers we post on osportal.remedy.nl > >> and extend it with the method you think we should add? Than we can > >> easily prototype this in our product and see if we don't miss > anything. > >> > >> Johnny > >> > >> On 06/11/2012 09:21 PM, Sumant Tambe wrote: > >>> Ok. I'll take a shot at it. > >>> Will you attend the OMG tech meeting in Boston? > >>> May be I'll have it by then and you can review it at that time. > >>> > >>> Sumant > >>> > >>> Sumant Tambe, Ph.D. > >>> Software Research Engineer > >>> 408.990.7429 > >>> sumant@rti.com > >>> www.rti.com > >>> > >>>> -----Original Message----- > >>>> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >>>> Sent: Monday, June 11, 2012 11:40 AM > >>>> To: Sumant Tambe > >>>> Cc: idl2cpp11-ftf@omg.org > >>>> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > >> (IDL2C++11) > >>>> FTF issue > >>>> > >>>> Hi Sumant, > >>>> > >>>> Given the fact that you have posted more about this topic and have > >>>> the concrete experience, could you maybe write a concrete proposal > >>>> section which can be added to the spec? > >>>> > >>>> Johnny > >>>> > >>>> On 06/11/2012 08:28 PM, Juergen Boldt wrote: > >>>>> > >>>>>> From: webmaster@omg.org > >>>>>> Date: 11 Jun 2012 02:10:55 -0400 > >>>>>> To: > >>>>>> Subject: Issue/Bug Report > >>>>>> > >>>>>> > >>>> ********************************************************** > >>>> *********** > >>>>>> ********** > >>>>>> Name: Sumant Tambe > >>>>>> Employer: Real-Time Innovations > >>>>>> mailFrom: sumant@rti.com > >>>>>> Terms_Agreement: I agree > >>>>>> Specification: IDL to C++11 Language Mapping (IDL2C++11) > >>>>>> Section: 6.13.1 > >>>>>> FormalNumber: ptc/12-04-03 > >>>>>> Version: FTF - Beta 1 > >>>>>> Doc_Year: 2012 > >>>>>> Doc_Month: April > >>>>>> Doc_Day: 01 > >>>>>> Page: 14 > >>>>>> Title: In-place construction of structure types > >>>>>> Nature: Enhancement > >>>>>> Severity: Significant > >>>>>> CODE: 3TMw8 > >>>>>> B1: Report Issue > >>>>>> > >>>>>> Description: > >>>>>> > >>>>>> There are two main motivations: > >>>>>> > >>>>>> (1) Performance: IDL types may be large and not all IDL types > may > >>>>>> have > >>>>>> C++11 mapping with efficient move constructors. For example, an > >> IDL > >>>>>> structure containing an array does not have an efficient move- > >> ctor. > >>>>>> Current mapping for an IDL struct type (section 6.13.1) requires > >> an > >>>>>> explicit constructor accepting values for each member by value > in > >>>>>> the order they are specified in IDL. Although this method is > >>>>>> sufficient in most cases, it is not optimal. Particularly, the > >>>>>> types that don't support efficient move-ctor. > >>>>>> > >>>>>> (2) Usability: Often C++11 standard library containers could be > >>>>>> constructed using several alternatives. For instance, a string > >>>>>> member in a struct may be constructed using any of its 9 > >>>>>> constructors or a vector may be constructed using any of its 7 > >>>>>> constructors. Currently, the IDL2C++11 specification allows > >>>>>> construction of members of a structure using only two kinds of > >>>>>> constructors: copy-ctor and move-ctor. (due to the pass-by-value > >>>>>> rule mentioned above) > >>>>>> > >>>>>> Resolution: The IDL2C++11 mapping of structures could be > enhanced > >>>>>> to construct large objects in-place. Provide a way to construct > >> the > >>>>>> member objects of a struct in-place using a perfect-forwarding > >>>>>> constructor. The intent is to support all the ways of > >>>>>> constructing all the member objects from the constructor of the > parent object. > >>>>>> Moreover, a perfect-forwarding constructor may eliminate the > need > >>>>>> for a move, which may lead to some performance improvements. > >>>>>> > >>>>>> The solution relies on an idiom known as piecewise_construct > >> idiom. > >>>>>> It relies on a perfect-forwarding constructor that takes as many > >>>>>> tuples as there are members in a struct. Each tuple encapsulates > >>>>>> the parameters to construct one member. Tuples are needed > because > >>>> member > >>>>>> ctor could take several parameters and the user may be > interested > >>>>>> in using them. For instance, using an allocator for std::vector. > >>>>>> The user of the struct calls std::forward_as_tuple for each > >>>>>> member object to group the parameters in a tuple. The special > >>>>>> constructor simply forwards the tuples to the respective member. > >>>>>> > >>>>>> The C++ standard library uses this idiom for std::map and > >>>>>> std::unordered_map to construct complex objects in-place using > >>>>>> the emplace operations. However, more general uses have been > >> identified: > >>>>>> http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- > >>>> parameter > >>>>>> -groups.html > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> Juergen Boldt > >>>>> Director, Member Services > >>>>> 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA > >>>>> > >>>>> Tel: 781 444 0404 x 132 > >>>>> fax: 781 444 0320 > >>>>> > >>>>> www.omg.org > >>>>> > >>>>> [] > >>> > >>> > > > > idl2cpp11-piecewise-construct.cpp DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:references:in-reply-to:mime-version:content-type:message-id :content-transfer-encoding:cc:x-mailer:from:subject:date:to; bh=rl8NiASq+GgbEK1dsa5jfaCmoQWnPPPv5myuaIiQRg4=; b=gumJsXz3nSboQKqCsd7tIXwNPdXpGakXnfb+mnOESbG5XWn9gZnj2UhE34JI5ycXYM xSxSZ3tFQvFldTrKLcnLhC1lh5pKW5TnySbR0CxQpk8WFP1Z1l1+8I73c4Ni/y5y3YjQ WbWkoCs2E6uWGAi1Jxfb1sHBEK/uUMYsdhvPooLejp18n8ZVMflZCus3Bgabq12LpyTg 437iGMA31/xyVwTCWQrl/zZ5kvSTFlR2GhEACeNvKlOnZu5qYVdjgr0BRkwPt5pp2MN4 1hT9T9GlE5OEv281TM4BzqpAT7f4XMUzq41RCRPcJpMrGHUMnJX4w8daTVgT3QAKFsyZ bwKA== Sender: Johnny Willemsen Cc: "idl2cpp11-ftf@omg.org" X-Mailer: iPad Mail (9B206) From: Johnny Willemsen Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Date: Tue, 12 Jun 2012 21:49:19 +0200 To: Sumant Tambe X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q5CJnaxb026746 Hi, Thanks, do you have also a proposed text addition for the spec? Johnny Op 12 jun. 2012 om 21:45 heeft Sumant Tambe het volgende geschreven: > I extended the Variable class in testC.h. I got rid of most of the clutter because I don't have TAO for C++11. The attached file focuses only on the proposed addition. > It seems to work on gcc4.7+ and clang3.2. > > Let me know if you have any questions. > > Sumant > > Sumant Tambe, Ph.D. > Software Research Engineer > 408.990.7429 > sumant@rti.com > www.rti.com > > >> -----Original Message----- >> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] >> Sent: Tuesday, June 12, 2012 11:55 AM >> To: Sumant Tambe >> Cc: idl2cpp11-ftf@omg.org >> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) >> FTF issue >> >> Hi, >> >>> I'm not sure what headers you are referring to on osportal.remedy.nl. >> Will it be easier if I check code into the git repository you have? >> >> One of the examples listed at the link below, this are just the >> generated headers with inline code, not the full product. If you can >> show with one of the examples what you would like to add, it will make >> things probably much more clear >> >> Johnny >> >> https://osportal.remedy.nl/projects/idl2cppx0/repository/revisions/mast >> er/show/examples >>> >>> Regards, >>> Sumant >>> >>> Sumant Tambe, Ph.D. >>> Software Research Engineer >>> 408.990.7429 >>> sumant@rti.com >>> www.rti.com >>> >>>> -----Original Message----- >>>> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] >>>> Sent: Tuesday, June 12, 2012 11:00 AM >>>> To: Sumant Tambe >>>> Cc: idl2cpp11-ftf@omg.org >>>> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping >> (IDL2C++11) >>>> FTF issue >>>> >>>> Hi, >>>> >>>> Maybe you can take on of the headers we post on osportal.remedy.nl >>>> and extend it with the method you think we should add? Than we can >>>> easily prototype this in our product and see if we don't miss >> anything. >>>> >>>> Johnny >>>> >>>> On 06/11/2012 09:21 PM, Sumant Tambe wrote: >>>>> Ok. I'll take a shot at it. >>>>> Will you attend the OMG tech meeting in Boston? >>>>> May be I'll have it by then and you can review it at that time. >>>>> >>>>> Sumant >>>>> >>>>> Sumant Tambe, Ph.D. >>>>> Software Research Engineer >>>>> 408.990.7429 >>>>> sumant@rti.com >>>>> www.rti.com >>>>> >>>>>> -----Original Message----- >>>>>> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] >>>>>> Sent: Monday, June 11, 2012 11:40 AM >>>>>> To: Sumant Tambe >>>>>> Cc: idl2cpp11-ftf@omg.org >>>>>> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping >>>> (IDL2C++11) >>>>>> FTF issue >>>>>> >>>>>> Hi Sumant, >>>>>> >>>>>> Given the fact that you have posted more about this topic and have >>>>>> the concrete experience, could you maybe write a concrete proposal >>>>>> section which can be added to the spec? >>>>>> >>>>>> Johnny >>>>>> >>>>>> On 06/11/2012 08:28 PM, Juergen Boldt wrote: >>>>>>> >>>>>>>> From: webmaster@omg.org >>>>>>>> Date: 11 Jun 2012 02:10:55 -0400 >>>>>>>> To: >>>>>>>> Subject: Issue/Bug Report >>>>>>>> >>>>>>>> >>>>>> ********************************************************** >>>>>> *********** >>>>>>>> ********** >>>>>>>> Name: Sumant Tambe >>>>>>>> Employer: Real-Time Innovations >>>>>>>> mailFrom: sumant@rti.com >>>>>>>> Terms_Agreement: I agree >>>>>>>> Specification: IDL to C++11 Language Mapping (IDL2C++11) >>>>>>>> Section: 6.13.1 >>>>>>>> FormalNumber: ptc/12-04-03 >>>>>>>> Version: FTF - Beta 1 >>>>>>>> Doc_Year: 2012 >>>>>>>> Doc_Month: April >>>>>>>> Doc_Day: 01 >>>>>>>> Page: 14 >>>>>>>> Title: In-place construction of structure types >>>>>>>> Nature: Enhancement >>>>>>>> Severity: Significant >>>>>>>> CODE: 3TMw8 >>>>>>>> B1: Report Issue >>>>>>>> >>>>>>>> Description: >>>>>>>> >>>>>>>> There are two main motivations: >>>>>>>> >>>>>>>> (1) Performance: IDL types may be large and not all IDL types >> may >>>>>>>> have >>>>>>>> C++11 mapping with efficient move constructors. For example, an >>>> IDL >>>>>>>> structure containing an array does not have an efficient move- >>>> ctor. >>>>>>>> Current mapping for an IDL struct type (section 6.13.1) requires >>>> an >>>>>>>> explicit constructor accepting values for each member by value >> in >>>>>>>> the order they are specified in IDL. Although this method is >>>>>>>> sufficient in most cases, it is not optimal. Particularly, the >>>>>>>> types that don't support efficient move-ctor. >>>>>>>> >>>>>>>> (2) Usability: Often C++11 standard library containers could be >>>>>>>> constructed using several alternatives. For instance, a string >>>>>>>> member in a struct may be constructed using any of its 9 >>>>>>>> constructors or a vector may be constructed using any of its 7 >>>>>>>> constructors. Currently, the IDL2C++11 specification allows >>>>>>>> construction of members of a structure using only two kinds of >>>>>>>> constructors: copy-ctor and move-ctor. (due to the pass-by-value >>>>>>>> rule mentioned above) >>>>>>>> >>>>>>>> Resolution: The IDL2C++11 mapping of structures could be >> enhanced >>>>>>>> to construct large objects in-place. Provide a way to construct >>>> the >>>>>>>> member objects of a struct in-place using a perfect-forwarding >>>>>>>> constructor. The intent is to support all the ways of >>>>>>>> constructing all the member objects from the constructor of the >> parent object. >>>>>>>> Moreover, a perfect-forwarding constructor may eliminate the >> need >>>>>>>> for a move, which may lead to some performance improvements. >>>>>>>> >>>>>>>> The solution relies on an idiom known as piecewise_construct >>>> idiom. >>>>>>>> It relies on a perfect-forwarding constructor that takes as many >>>>>>>> tuples as there are members in a struct. Each tuple encapsulates >>>>>>>> the parameters to construct one member. Tuples are needed >> because >>>>>> member >>>>>>>> ctor could take several parameters and the user may be >> interested >>>>>>>> in using them. For instance, using an allocator for std::vector. >>>>>>>> The user of the struct calls std::forward_as_tuple for each >>>>>>>> member object to group the parameters in a tuple. The special >>>>>>>> constructor simply forwards the tuples to the respective member. >>>>>>>> >>>>>>>> The C++ standard library uses this idiom for std::map and >>>>>>>> std::unordered_map to construct complex objects in-place using >>>>>>>> the emplace operations. However, more general uses have been >>>> identified: >>>>>>>> http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- >>>>>> parameter >>>>>>>> -groups.html >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Juergen Boldt >>>>>>> Director, Member Services >>>>>>> 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA >>>>>>> >>>>>>> Tel: 781 444 0404 x 132 >>>>>>> fax: 781 444 0320 >>>>>>> >>>>>>> www.omg.org >>>>>>> >>>>>>> [] >>>>> >>>>> >>> >>> > > X-Virus-Scanned: amavisd-new at rti.com From: Sumant Tambe To: Johnny Willemsen CC: "idl2cpp11-ftf@omg.org" Date: Tue, 12 Jun 2012 13:28:04 -0700 Subject: RE: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Topic: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) FTF issue Thread-Index: Ac1I1HiUcFnsnU49TQy/nOtpQjAwnwABT4Rw Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q5CKSKgR031830 No! Not yet! Sumant Tambe, Ph.D. Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com > -----Original Message----- > From: Johnny Willemsen [mailto:jwillemsenu@gmail.com] On Behalf Of > Johnny Willemsen > Sent: Tuesday, June 12, 2012 12:49 PM > To: Sumant Tambe > Cc: idl2cpp11-ftf@omg.org > Subject: Re: issue 17420 -- IDL to C++11 Language Mapping (IDL2C++11) > FTF issue > > Hi, > > Thanks, do you have also a proposed text addition for the spec? > > Johnny > > > > Op 12 jun. 2012 om 21:45 heeft Sumant Tambe het > volgende geschreven: > > > I extended the Variable class in testC.h. I got rid of most of the > clutter because I don't have TAO for C++11. The attached file focuses > only on the proposed addition. > > It seems to work on gcc4.7+ and clang3.2. > > > > Let me know if you have any questions. > > > > Sumant > > > > Sumant Tambe, Ph.D. > > Software Research Engineer > > 408.990.7429 > > sumant@rti.com > > www.rti.com > > > > > >> -----Original Message----- > >> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >> Sent: Tuesday, June 12, 2012 11:55 AM > >> To: Sumant Tambe > >> Cc: idl2cpp11-ftf@omg.org > >> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > (IDL2C++11) > >> FTF issue > >> > >> Hi, > >> > >>> I'm not sure what headers you are referring to on > osportal.remedy.nl. > >> Will it be easier if I check code into the git repository you have? > >> > >> One of the examples listed at the link below, this are just the > >> generated headers with inline code, not the full product. If you can > >> show with one of the examples what you would like to add, it will > >> make things probably much more clear > >> > >> Johnny > >> > >> > https://osportal.remedy.nl/projects/idl2cppx0/repository/revisions/ma > >> st > >> er/show/examples > >>> > >>> Regards, > >>> Sumant > >>> > >>> Sumant Tambe, Ph.D. > >>> Software Research Engineer > >>> 408.990.7429 > >>> sumant@rti.com > >>> www.rti.com > >>> > >>>> -----Original Message----- > >>>> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >>>> Sent: Tuesday, June 12, 2012 11:00 AM > >>>> To: Sumant Tambe > >>>> Cc: idl2cpp11-ftf@omg.org > >>>> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > >> (IDL2C++11) > >>>> FTF issue > >>>> > >>>> Hi, > >>>> > >>>> Maybe you can take on of the headers we post on osportal.remedy.nl > >>>> and extend it with the method you think we should add? Than we can > >>>> easily prototype this in our product and see if we don't miss > >> anything. > >>>> > >>>> Johnny > >>>> > >>>> On 06/11/2012 09:21 PM, Sumant Tambe wrote: > >>>>> Ok. I'll take a shot at it. > >>>>> Will you attend the OMG tech meeting in Boston? > >>>>> May be I'll have it by then and you can review it at that time. > >>>>> > >>>>> Sumant > >>>>> > >>>>> Sumant Tambe, Ph.D. > >>>>> Software Research Engineer > >>>>> 408.990.7429 > >>>>> sumant@rti.com > >>>>> www.rti.com > >>>>> > >>>>>> -----Original Message----- > >>>>>> From: Johnny Willemsen [mailto:jwillemsen@remedy.nl] > >>>>>> Sent: Monday, June 11, 2012 11:40 AM > >>>>>> To: Sumant Tambe > >>>>>> Cc: idl2cpp11-ftf@omg.org > >>>>>> Subject: Re: issue 17420 -- IDL to C++11 Language Mapping > >>>> (IDL2C++11) > >>>>>> FTF issue > >>>>>> > >>>>>> Hi Sumant, > >>>>>> > >>>>>> Given the fact that you have posted more about this topic and > >>>>>> have the concrete experience, could you maybe write a concrete > >>>>>> proposal section which can be added to the spec? > >>>>>> > >>>>>> Johnny > >>>>>> > >>>>>> On 06/11/2012 08:28 PM, Juergen Boldt wrote: > >>>>>>> > >>>>>>>> From: webmaster@omg.org > >>>>>>>> Date: 11 Jun 2012 02:10:55 -0400 To: > >>>>>>>> Subject: Issue/Bug Report > >>>>>>>> > >>>>>>>> > >>>>>> ********************************************************** > >>>>>> *********** > >>>>>>>> ********** > >>>>>>>> Name: Sumant Tambe > >>>>>>>> Employer: Real-Time Innovations > >>>>>>>> mailFrom: sumant@rti.com > >>>>>>>> Terms_Agreement: I agree > >>>>>>>> Specification: IDL to C++11 Language Mapping (IDL2C++11) > >>>>>>>> Section: 6.13.1 > >>>>>>>> FormalNumber: ptc/12-04-03 > >>>>>>>> Version: FTF - Beta 1 > >>>>>>>> Doc_Year: 2012 > >>>>>>>> Doc_Month: April > >>>>>>>> Doc_Day: 01 > >>>>>>>> Page: 14 > >>>>>>>> Title: In-place construction of structure types > >>>>>>>> Nature: Enhancement > >>>>>>>> Severity: Significant > >>>>>>>> CODE: 3TMw8 > >>>>>>>> B1: Report Issue > >>>>>>>> > >>>>>>>> Description: > >>>>>>>> > >>>>>>>> There are two main motivations: > >>>>>>>> > >>>>>>>> (1) Performance: IDL types may be large and not all IDL types > >> may > >>>>>>>> have > >>>>>>>> C++11 mapping with efficient move constructors. For example, > an > >>>> IDL > >>>>>>>> structure containing an array does not have an efficient move- > >>>> ctor. > >>>>>>>> Current mapping for an IDL struct type (section 6.13.1) > >>>>>>>> requires > >>>> an > >>>>>>>> explicit constructor accepting values for each member by value > >> in > >>>>>>>> the order they are specified in IDL. Although this method is > >>>>>>>> sufficient in most cases, it is not optimal. Particularly, the > >>>>>>>> types that don't support efficient move-ctor. > >>>>>>>> > >>>>>>>> (2) Usability: Often C++11 standard library containers could > be > >>>>>>>> constructed using several alternatives. For instance, a string > >>>>>>>> member in a struct may be constructed using any of its 9 > >>>>>>>> constructors or a vector may be constructed using any of its 7 > >>>>>>>> constructors. Currently, the IDL2C++11 specification allows > >>>>>>>> construction of members of a structure using only two kinds of > >>>>>>>> constructors: copy-ctor and move-ctor. (due to the > >>>>>>>> pass-by-value rule mentioned above) > >>>>>>>> > >>>>>>>> Resolution: The IDL2C++11 mapping of structures could be > >> enhanced > >>>>>>>> to construct large objects in-place. Provide a way to > construct > >>>> the > >>>>>>>> member objects of a struct in-place using a perfect-forwarding > >>>>>>>> constructor. The intent is to support all the ways of > >>>>>>>> constructing all the member objects from the constructor of > the > >> parent object. > >>>>>>>> Moreover, a perfect-forwarding constructor may eliminate the > >> need > >>>>>>>> for a move, which may lead to some performance improvements. > >>>>>>>> > >>>>>>>> The solution relies on an idiom known as piecewise_construct > >>>> idiom. > >>>>>>>> It relies on a perfect-forwarding constructor that takes as > >>>>>>>> many tuples as there are members in a struct. Each tuple > >>>>>>>> encapsulates the parameters to construct one member. Tuples > are > >>>>>>>> needed > >> because > >>>>>> member > >>>>>>>> ctor could take several parameters and the user may be > >> interested > >>>>>>>> in using them. For instance, using an allocator for > std::vector. > >>>>>>>> The user of the struct calls std::forward_as_tuple for each > >>>>>>>> member object to group the parameters in a tuple. The special > >>>>>>>> constructor simply forwards the tuples to the respective > member. > >>>>>>>> > >>>>>>>> The C++ standard library uses this idiom for std::map and > >>>>>>>> std::unordered_map to construct complex objects in-place using > >>>>>>>> the emplace operations. However, more general uses have been > >>>> identified: > >>>>>>>> http://cpptruths.blogspot.com/2012/06/perfect-forwarding-of- > >>>>>> parameter > >>>>>>>> -groups.html > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> Juergen Boldt > >>>>>>> Director, Member Services > >>>>>>> 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA > >>>>>>> > >>>>>>> Tel: 781 444 0404 x 132 > >>>>>>> fax: 781 444 0320 > >>>>>>> > >>>>>>> www.omg.org > >>>>>>> > >>>>>>> [] > >>>>> > >>>>> > >>> > >>> > > > >