Re: [Boost-bugs] [Boost C++ Libraries] #5455: std::vector<byte_> not assignable to std::vector<unsigned char>

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5455: std::vector<byte_> not assignable to std::vector<unsigned char>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-12 05:33:12


#5455: std::vector<byte_> not assignable to std::vector<unsigned char>
-----------------------------------+----------------------------------------
  Reporter: jaredgrubb@… | Owner: djowel
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment (by jaredgrubb@…):

 {{{#!c++
 #include <boost/fusion/container/vector.hpp>
 #include <boost/fusion/adapted/struct/define_struct.hpp>
 #include <boost/spirit/include/phoenix.hpp>
 #include <boost/spirit/include/qi.hpp>
 #include <vector>

 BOOST_FUSION_DEFINE_STRUCT( (), Vector, (std::vector<unsigned char>, v))
 BOOST_FUSION_DEFINE_STRUCT( (), Byte, (unsigned char, b))

 int main(int argc, char * argv[])
 {
     using namespace boost::spirit::qi;
     using namespace boost::phoenix;

     /* r1 compiles fine: byte_ assigns to unsigned char */
     rule<char const *, Byte()> r1;
     r1 = byte_ [at_c<0>(_val)=_1];

     /* r2 does not compile: vector<byte_> does not assign to
 vector<unsigned char> */
     rule<char const *, Vector()> r2;
     r2 = (*byte_) [at_c<0>(_val)=_1];

     return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5455#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC