Hi Alan,

I have a question on this change to qpid/Url.h:

--- Url.h       (revision 693917)
+++ Url.h       (revision 693918)
@@ -45,7 +45,11 @@
 std::ostream& operator<<(std::ostream& os, const TcpAddress& a);

 /** Address is a variant of all address types, more coming in future.
*/
-typedef boost::variant<TcpAddress> Address;
+struct Address : public boost::variant<TcpAddress> {
+    template <class T> Address(const T& t) :
boost::variant<TcpAddress>(t) {}
+    template <class T> T* get() { return boost::get<T>(this); }
+    template <class T> const T* get() const { return
boost::get<T>(this); }
+};

With this change, the Windows Visual C++ 8 compiler chokes. Could you
elaborate a bit on why the change is there and what may be the issue
here? I've tried adjusting the template types to get around it but
have had no success.

Compiling...
Url.cpp
C:\Program Files
(x86)\boost\boost_1_35_0\boost/variant/variant.hpp(1342) : error
C2666: 'boost::variant::convert_construct' : 2 overloads have similar
conversions
        with
        [
            T0_=qpid::TcpAddress
        ]
        C:\Program Files
(x86)\boost\boost_1_35_0\boost/variant/variant.hpp(1327): could be
'void boost::variant::convert_construct(const boost::variant &,long)'
        with
        [
            T0_=qpid::TcpAddress
        ]
        C:\Program Files
(x86)\boost\boost_1_35_0\boost/variant/variant.hpp(1258): or 'void
boost::variant::convert_construct(T &,int,boost::mpl::false_)'
        with
        [
            T0_=qpid::TcpAddress,
            T=qpid::Address
        ]
        while trying to match the argument list '(const qpid::Address,
long)'
        C:\Program Files (x86)\Microsoft Visual Studio
8\VC\include\xstring(634) : see reference to function template
instantiation 'boost::variant::variant(const T &)' being compiled
        with
        [
            T0_=qpid::TcpAddress,
            T=qpid::Address
        ]

Reply via email to