In theory, you could add implicit conversion operators to one or both libraries (although implicit conversions aren't necessarily a good idea). But you've said you can't edit either libary, so that rules that out.
So one alternative would be to introduce your own vector class, and supply it with the necessary conversion operators. Then whenever you need a vector in your code, you always store it as an object of your custom class, and (implicitly) convert when you need to use the libraries.
But again, the trouble that implicit conversion can cause might outweigh the superficial benefits (see Item 5 of More Effective C++ for more details on this).
However, see Item 5 of Scott Meyers' More Effective C++, entitled "Be wary of user-defined conversion operations". Allowing implicit conversions to-and-from complex types can often lead to all sorts of subtle typo bugs.
There is no way of doing this - and if you need to do it, there is something wrong with your design. There is a discussion of why you can't do this in More Effective C++.
Yes, that is allowed. But general practice is to avoid concrete base classes of any sort (see e.g. Item 33 of Scott Meyers' More Effective C++).
Attempting to persist complex objects by storing their binary representation is bound to lead to all sorts of problems; I would suggest finding a better mechanism (serialization, etc.).
In theory, you could add implicit conversion operators to one or both libraries (although implicit conversions aren't necessarily a good idea). But you've said you can't edit either libary, so that rules that out.
So one alternative would be to introduce your own vector class, and supply it with the necessary conversion operators. Then whenever you need a vector in your code, you always store it as an object of your custom class, and (implicitly) convert when you need to use the libraries.
But again, the trouble that implicit conversion can cause might outweigh the superficial benefits (see Item 5 of More Effective C++ for more details on this).
Yes, you can overload type-conversion operators:
See http://ideone.com/Y7UwV for a demo.
However, see Item 5 of Scott Meyers' More Effective C++, entitled "Be wary of user-defined conversion operations". Allowing implicit conversions to-and-from complex types can often lead to all sorts of subtle typo bugs.
There is no way of doing this - and if you need to do it, there is something wrong with your design. There is a discussion of why you can't do this in More Effective C++.
Yes, that is allowed. But general practice is to avoid concrete base classes of any sort (see e.g. Item 33 of Scott Meyers' More Effective C++).
Attempting to persist complex objects by storing their binary representation is bound to lead to all sorts of problems; I would suggest finding a better mechanism (serialization, etc.).