[iostreams] container_device example does not compile?

Hello, I'm using the container_device example listed here (The full example near the bottom): http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/container_d... I modified this class to exist in the global namespace (i.e. not in boost::iostreams::example). It does not compile under MSVC9. I get the following errors. I have NO idea what the compiler is trying to tell me. 1>c:\it\work\vfdtester\ContainerDevice.hpp(50) : error C2061: syntax error : identifier 'stream_offset' 1> c:\it\work\vfdtester\ContainerDevice.hpp(79) : see reference to class template instantiation 'container_device<Container>' being compiled 1>c:\it\work\vfdtester\ContainerDevice.hpp(50) : error C2061: syntax error : identifier 'stream_offset' 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/traits.hpp(176) : see reference to class template instantiation 'container_device<Container>' being compiled 1> with 1> [ 1> Container=std::vector<boost::uint8_t> 1> ] 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/traits.hpp(188) : see reference to class template instantiation 'boost::iostreams::detail::member_char_type<T>' being compiled 1> with 1> [ 1> T=container_device<std::vector<boost::uint8_t>> 1> ] 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/stream.hpp(104) : see reference to class template instantiation 'boost::iostreams::char_type_of<T>' being compiled 1> with 1> [ 1> T=container_device<std::vector<boost::uint8_t>> 1> ] --------- Robert Dailey

Robert Dailey wrote:
Hello,
I'm using the container_device example listed here (The full example near the bottom): http://www.boost.org/doc/libs/1_39_0/libs/iostreams/doc/tutorial/container_d...
I modified this class to exist in the global namespace (i.e. not in boost::iostreams::example). It does not compile under MSVC9. I get the following errors. I have NO idea what the compiler is trying to tell me.
1>c:\it\work\vfdtester\ContainerDevice.hpp(50) : error C2061: syntax error : identifier 'stream_offset' 1> c:\it\work\vfdtester\ContainerDevice.hpp(79) : see reference to class template instantiation 'container_device<Container>' being compiled 1>c:\it\work\vfdtester\ContainerDevice.hpp(50) : error C2061: syntax error : identifier 'stream_offset' 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/traits.hpp(176) : see reference to class template instantiation 'container_device<Container>' being compiled 1> with 1> [ 1> Container=std::vector<boost::uint8_t> 1> ] 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/traits.hpp(188) : see reference to class template instantiation 'boost::iostreams::detail::member_char_type<T>' being compiled 1> with 1> [ 1> T=container_device<std::vector<boost::uint8_t>> 1> ] 1> C:\IT\third_party\boost_1_40_0_beta1\boost/iostreams/stream.hpp(104) : see reference to class template instantiation 'boost::iostreams::char_type_of<T>' being compiled 1> with 1> [ 1> T=container_device<std::vector<boost::uint8_t>> 1> ]
--------- Robert Dailey
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Are you prefixing stream_offset with the appropriate namespace? Since you put the class in the global namespace, you would need to do this where the example does not.

On Wed, Aug 26, 2009 at 8:51 AM, Kenny Riddile <kfriddile@yahoo.com> wrote:
Are you prefixing stream_offset with the appropriate namespace? Since you put the class in the global namespace, you would need to do this where the example does not.
Yes, I adjusted the scope resolution as necessary. However, that is why the errors above appear. If I remove scope resolution on stream_offset it fails differently. However, I used the version from the actual source file (i.e. not the one embedded in the HTML) and it works. It is a bit different, too. Not sure what the problem was. However, I no longer need this class anymore as I have decided to use a different solution. Thanks for the help Kenny.
participants (2)
-
Kenny Riddile
-
Robert Dailey