Issue 16338: Compilation errors on Visual Studio 2008/2010 (dds-psm-cxx-ftf) Source: Real-Time Innovations (Dr. Sumant Tambe, sumant(at)rti.com) Nature: Revision Severity: Critical Summary: Description: The sources obtained from dds-psm-cxx.googlecode.com do not compile on Visual Studio compilers without significant efforts. There are multiple issues most related to type conversion. 1. All the classes that inherit from dds::core::Value<D> seem to be missing a copy-ctor. For example, QosPolicyCount in src\hpp\tdds\core\policy\QosPolicyCount.hpp. Without a copy-ctor, VS2010 issues a “cannot convert from ...” error. Most of these classes are found in the following files: src\hpp\tdds\core\InstanceHandle.hpp src\hpp\tdds\core\policy\CorePolicy.hpp src\hpp\tdds\core\policy\QosPolicyCount.hpp src\hpp\tdds\core\qos\EntityQos.hpp Proposed Solution: Add a copy constructor to all the classes that inherit from dds::core::Value<D> as follows: QosPolicyCount(const QosPolicyCount& src) : dds::core::Value<DELEGATE>(src.delegate()) { } 2. The exception classes in dds-psm-cxx\src\hpp\dds\core\Exception.hpp do not need copy-ctor because there is nothing to copy and the base classes don’t have copy constructors either. Proposed resolution: Remove the declarations of copy constructors in dds-psm-cxx\src\hpp\dds\core\Exception.hpp 3. The private constructor of SampleRejectedStatus in dds-psm-cxx-read-only\src\hpp\dds\core\status\State.hpp needs a typecast to avoid compilation errors on Visual studio versions of STL. The following constructor can’t be called due to ambiguous overloads of bistset<N> constructors. private: SampleRejectedState(uint32_t s) : MaskType(s) { } Proposed solution: Change the call to the base constructor to include an explicit static_cast to int. private: SampleRejectedState(uint32_t s) : MaskType(static_cast<int>(s)) { } Resolution: Revised Text: Actions taken: June 17, 2011: received isse Discussion: End of Annotations:===== m: webmaster@omg.org Date: 17 Jun 2011 17:16:33 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Sumant Employer: Real-Time Innovations mailFrom: sumant@rti.com Terms_Agreement: I agree Specification: DDS PSM CXX Section: 7 FormalNumber: ptc/2011-01-02 Version: FTF Beta 1 Doc_Year: 2011 Doc_Month: January Doc_Day: 01 Page: 4 Title: Compilation errors on Visual Studio 2008/2010 Nature: Revision Severity: Critical CODE: 3TMw8 B1: Report Issue Description: Description: The sources obtained from dds-psm-cxx.googlecode.com do not compile on Visual Studio compilers without significant efforts. There are multiple issues most related to type conversion. 1. All the classes that inherit from dds::core::Value seem to be missing a copy-ctor. For example, QosPolicyCount in src\hpp\tdds\core\policy\QosPolicyCount.hpp. Without a copy-ctor, VS2010 issues a .cannot convert from .... error. Most of these classes are found in the following files: src\hpp\tdds\core\InstanceHandle.hpp src\hpp\tdds\core\policy\CorePolicy.hpp src\hpp\tdds\core\policy\QosPolicyCount.hpp src\hpp\tdds\core\qos\EntityQos.hpp Proposed Solution: Add a copy constructor to all the classes that inherit from dds::core::Value as follows: QosPolicyCount(const QosPolicyCount& src) : dds::core::Value(src.delegate()) { } 2. The exception classes in dds-psm-cxx\src\hpp\dds\core\Exception.hpp do not need copy-ctor because there is nothing to copy and the base classes don.t have copy constructors either. Proposed resolution: Remove the declarations of copy constructors in dds-psm-cxx\src\hpp\dds\core\Exception.hpp 3. The private constructor of SampleRejectedStatus in dds-psm-cxx-read-only\src\hpp\dds\core\status\State.hpp needs a typecast to avoid compilation errors on Visual studio versions of STL. The following constructor can.t be called due to ambiguous overloads of bistset constructors. private: SampleRejectedState(uint32_t s) : MaskType(s) { } Proposed solution: Change the call to the base constructor to include an explicit static_cast to int. private: SampleRejectedState(uint32_t s) : MaskType(static_cast(s)) { }