128 bit string to array using boost::spirit::*
问题 I am currently starting with boost::spirit::*. I try to parse a 128 bit string into a simple c array with corresponding size. I created a short test which does the job: boost::spirit::qi::int_parser< boost::uint8_t, 16, 2, 2 > uint8_hex; std::string src( "00112233445566778899aabbccddeeff" ); boost::uint8_t dst[ 16 ]; bool r; for( std::size_t i = 0; i < 16; ++i ) { r = boost::spirit::qi::parse( src.begin( ) + 2 * i, src.begin( ) + 2 * i + 2, uint8_hex, dst[ i ] ); } I have the feeling that