Issue 16405: Supporting automatic conversion from value types to delegate types (dds-psm-cxx-ftf) Source: Real-Time Innovations (Dr. Sumant Tambe, sumant(at)rti.com) Nature: Enhancement Severity: Significant Summary: Supporting some vendor-specific extension api is significantly easier using automatic conversion from value types to the delegate types. The situation arises when an extension method defined in the idds namespace takes a parameter defined only in the idds namespace. The parameter type may also be used as a delegate elsewhere. While the programmers can use the -> operator to invoke the extension method, the parameter need must be obtained using the delegate() method of the value type. It would be quite seamless to support automatic convertibility from value types to the delegate. Proposed Solution: Define two additional generic conversion operators in dds::core::Value<D> template. operator D & () { return d_; } operator const D & () const { return d_; } ; Resolution: Revised Text: Actions taken: July 29, 2011: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 29 Jul 2011 21:15:18 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Sumant Tambe Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: DDS C++ PSM Section: 7 FormalNumber: ptc/2011-01-02 Version: Beta 1 Doc_Year: 2011 Doc_Month: January Doc_Day: 02 Page: 4 Title: Supporting automatic conversion from value types to delegate types Nature: Enhancement Severity: Significant CODE: 3TMw8 B1: Report Issue Description: Supporting some vendor-specific extension api is significantly easier using automatic conversion from value types to the delegate types. The situation arises when an extension method defined in the idds namespace takes a parameter defined only in the idds namespace. The parameter type may also be used as a delegate elsewhere. While the programmers can use the -> operator to invoke the extension method, the parameter need must be obtained using the delegate() method of the value type. It would be quite seamless to support automatic convertibility from value types to the delegate. Proposed Solution: Define two additional generic conversion operators in dds::core::Value template. operator D & () { return d_; } operator const D & () const { return d_; } ;