[xsd-users] Ambiguous ostream operator

Boris Kolpackov boris at codesynthesis.com
Mon Jun 18 10:15:49 EDT 2007


Hi Dave,

david.r.moss at selex-comms.com <david.r.moss at selex-comms.com> writes:

> xsd cxx-tree --generate-serialization empty-list-test.xsd
>
> i get the 'error C2593: 'operator <<' is ambiguous' error with the
> following code:
>
> //         cout << "list:" << l << "." << endl;

I am not sure why VC++ complains about it being ambiguous. g++ correctly
points out that there is simply no match. I think VC++ is confused by
the serialization operators (which do not match anyway). In any case,
you need to add the --generate-ostream option to the command line in
order to get ostream operators for generated types. After adding this
option the code compiles fine for me.

> I discovered this while trying to figure out why an empty list read from
> file (see attached xml) resulted in an object containing one
> (garbage-looking) item - i was using xsd version 2.3.1 at the time; that
> bug seems to have been fixed in 3.0.0.b1!

Let me know if you have to stick with 2.3.1 and I will try to come up
with a patch. Otherwise you can use 3.0.0.b1. It has quite a few new
features and bugfixes.

hth,
-boris




More information about the xsd-users mailing list