BOOST_TYPEOF in 1.34 can't work with VC8

It seems that BOOSTTYPEOF in 1.34 doesn't work in VC8. I try to copy boost\typeof\msvc\typeof_impl.hpp and boost\typeof\typeof.hpp from CVS HEAD to 1.34 and it works. Did I do something wrong or there is a bug?

"Minmin Gong" <gongminmin@yeah.net> wrote
It seems that BOOSTTYPEOF in 1.34 doesn't work in VC8. I try to copy boost\typeof\msvc\typeof_impl.hpp and boost\typeof\typeof.hpp from CVS HEAD to 1.34 and it works. Did I do something wrong or there is a bug?
I suspect you might be trying to use the MSVC "native" mode, which is available in head but not in 1.34.0. Look for the "using typeof emulation/native typeof" compiler message. Which one is it? In 1.34.0 you have to use emulation mode with vc8.0. It is supposed to be used by default. Did you by any chance define BOOST_TYPEOF_NATIVE? Regards, Arkadiy

Arkadiy Vertleyb wrote:
"Minmin Gong" <gongminmin@yeah.net> wrote
It seems that BOOSTTYPEOF in 1.34 doesn't work in VC8. I try to copy boost\typeof\msvc\typeof_impl.hpp and boost\typeof\typeof.hpp from CVS HEAD to 1.34 and it works. Did I do something wrong or there is a bug?
I suspect you might be trying to use the MSVC "native" mode, which is available in head but not in 1.34.0. Look for the "using typeof emulation/native typeof" compiler message. Which one is it?
In 1.34.0 you have to use emulation mode with vc8.0. It is supposed to be used by default. Did you by any chance define BOOST_TYPEOF_NATIVE?
Or perhaps you didn't register your types, which is required in 1.34, but not in the version currently in CVS. We can't know unless you supply code that reproduces your error. -- Eric Niebler Boost Consulting www.boost-consulting.com

Eric Niebler wrote:
Arkadiy Vertleyb wrote:
"Minmin Gong" <gongminmin@yeah.net> wrote
It seems that BOOSTTYPEOF in 1.34 doesn't work in VC8. I try to copy boost\typeof\msvc\typeof_impl.hpp and boost\typeof\typeof.hpp from CVS HEAD to 1.34 and it works. Did I do something wrong or there is a bug? I suspect you might be trying to use the MSVC "native" mode, which is available in head but not in 1.34.0. Look for the "using typeof emulation/native typeof" compiler message. Which one is it?
In 1.34.0 you have to use emulation mode with vc8.0. It is supposed to be used by default. Did you by any chance define BOOST_TYPEOF_NATIVE?
Or perhaps you didn't register your types, which is required in 1.34, but not in the version currently in CVS. We can't know unless you supply code that reproduces your error.
Thanks for your reply. This is my test code: #include <iostream> #include <vector> #include <boost/typeof/typeof.hpp> #include <boost/foreach.hpp> using namespace std; int main() { std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); v.push_back(4); BOOST_FOREACH(BOOST_TYPEOF(v)::reference i, v) { cout << i << endl; } } The compile output is: using typeof emulation d:\boost\boost\typeof\encode_decode.hpp(47) : error C2504: '`anonymous-namespace'::boost_typeof::encode_type_impl<V,Type_Not_Registered_With_Typeof_System>' : base class undefined with [ V=boost::type_of::vector0<>, Type_Not_Registered_With_Typeof_System=std::vector<int> ] d:\test\testtypeof\testtypeof.cpp(17) : see reference to class template instantiation 'boost::type_of::encode_type<V,T>' being compiled with [ V=boost::type_of::vector0<>, T=std::vector<int> ] ... Do I need to register types such as std::vector, boost::array, etc. myself?

"Minmin Gong" <gongminmin@yeah.net> wrote
The compile output is: using typeof emulation d:\boost\boost\typeof\encode_decode.hpp(47) : error C2504:
'`anonymous-namespace'::boost_typeof::encode_type_impl<V,Type_Not_Registered _With_Typeof_System>'
: base class undefined with [ V=boost::type_of::vector0<>, Type_Not_Registered_With_Typeof_System=std::vector<int> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [...] Do I need to register types such as std::vector, boost::array, etc. myself?
Eric was right -- this is a problem with the registration. This will go away once the "native" mode for vc8 is introduced (currently in CVS). For now you can register types. Your immediate issue is with vector<int>, and you can cure it like this: #include <boost/typeof/std/vector.hpp> instead of #include <vector> If you need boost::array, you will have to register it youself. Regards, Arkadiy

Arkadiy Vertleyb wrote:
"Minmin Gong" <gongminmin@yeah.net> wrote
The compile output is: using typeof emulation d:\boost\boost\typeof\encode_decode.hpp(47) : error C2504:
'`anonymous-namespace'::boost_typeof::encode_type_impl<V,Type_Not_Registered _With_Typeof_System>'
: base class undefined with [ V=boost::type_of::vector0<>, Type_Not_Registered_With_Typeof_System=std::vector<int> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [...] Do I need to register types such as std::vector, boost::array, etc. myself?
Eric was right -- this is a problem with the registration. This will go away once the "native" mode for vc8 is introduced (currently in CVS).
For now you can register types. Your immediate issue is with vector<int>, and you can cure it like this:
#include <boost/typeof/std/vector.hpp>
instead of
#include <vector>
If you need boost::array, you will have to register it youself.
Regards, Arkadiy
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thanks a loooot!!!! BTW: will the typeof in CVS be merged into next release?

Arkadiy Vertleyb wrote:
"Minmin Gong" <gongminmin@yeah.net> wrote
BTW: will the typeof in CVS be merged into next release?
I am not sure what the next release is going to be. But it will definitely be included into the first release based on the current CVS (1.35?).
Regards, Arkadiy
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thanks. It's great if we can see this in 1.34.1, so I added a ticket: http://svn.boost.org/trac/boost/ticket/1004

Minmin Gong wrote:
Arkadiy Vertleyb wrote:
"Minmin Gong" <gongminmin@yeah.net> wrote
BTW: will the typeof in CVS be merged into next release? I am not sure what the next release is going to be. But it will definitely be included into the first release based on the current CVS (1.35?).
Thanks. It's great if we can see this in 1.34.1, so I added a ticket: http://svn.boost.org/trac/boost/ticket/1004
Let me stick my nose where it doesn't belong. 1.34.1 is a bug-fix release. It is NOT for new features. This is not a bug. It better wait. My $.02, -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (4)
-
Arkadiy Vertleyb
-
Eric Niebler
-
Minmin Gong
-
Thomas Witt