Linux Programming

g++ error: conversion from XTestObjectA to non-scalar type XTestObjectBase requested

cite from: http://stackoverflow.com/questions/6120240/why-constructor-is-not-called-for-given-casting-operator The problem is that the number of user-defined conversions that are invoked implicitly is limited (to 1) by the Standard. B ob = a; implies two user conversions: on a: Wrap::operator A*() should be called on the result: B::B(A*) should be called The solution is to use explicit conversion

Continue Reading