Commits

alamaison  committed ccf97b3

Fix template argument inference problems in com_error_from_interface.

In some situations, when passing in raw interface pointer, the compiler couldn't infoer the template parameter of the com_ptr argument. Overloading com_error_from_interface with a version specifically for raw pointers seems to help.

  • Participants
  • Parent commits 00c4cbc

Comments (0)

Files changed (1)

File include/comet/error.h

 	 * \todo  Can we add an optional user-defined message to this?
 	 */
 	template<typename Itf>
+	com_error com_error_from_interface(Itf* failure_source, HRESULT hr)
+	{
+		if (impl::supports_ErrorInfo(failure_source))
+			return com_error(hr, impl::GetErrorInfo());
+		else
+			return com_error(hr);
+	}
+
+	template<typename Itf>
 	com_error com_error_from_interface(
 		com_ptr<Itf> failure_source, HRESULT hr)
 	{
-		if (impl::supports_ErrorInfo(failure_source.get()))
-			return com_error(hr, impl::GetErrorInfo());
-		else
-			return com_error(hr);
+		return com_error_from_interface(failure_source.get(), hr);
 	}
 
 	//@}