Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 962 Bytes

compiler-error-c2594.md

File metadata and controls

31 lines (25 loc) · 962 Bytes
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: Compiler Error C2594
Compiler Error C2594
11/04/2016
C2594
C2594
68cd708f-266e-44b0-a211-3e3ab63b11bf

Compiler Error C2594

'operator' : ambiguous conversions from 'type1' to 'type2'

No conversion from type1 to type2 was more direct than any other. We suggest two possible solutions to converting from type1 to type2. The first option is to define a direct conversion from type1 to type2, and the second option is to specify a sequence of conversions from type1 to type2.

The following sample generates C2594. The suggested resolution to the error is a sequence of conversions:

// C2594.cpp// compile with: /cstructA{}; structI1 : A {}; structI2 : A {}; structD : I1, I2 {}; A *f (D *p) { return (A*) (p); // C2594// try the following line instead// return static_cast<A *>(static_cast<I1 *>(p)); }
close