int main(){ const char* st = "48656C6C6F3B"; int length = strlen( st); int i; char buf = 0; for( i = 0; i < length; i++){ if ( i % 2 != 0){ printf("%c", hex_to_ascii( buf, st[ i])); } else{ buf = st[ i]; } } binary( 11); binary( 56); binary2( 11); binary2( 56); }
void test_sequence_n(Sequence & seq, mpl::int_<2>) { fobj f; COMPARE_EFFECT(f (element1, element2), fusion::invoke_procedure(f , seq)); COMPARE_EFFECT(f (element1, const_(element2)), fusion::invoke_procedure(f , const_(seq))); COMPARE_EFFECT(const_(f)(element1, element2), fusion::invoke_procedure<fobj const>(const_(f), seq)); COMPARE_EFFECT(const_(f)(element1, const_(element2)), fusion::invoke_procedure<fobj const>(const_(f), const_(seq))); COMPARE_EFFECT(binary1(element1, element2), fusion::invoke_procedure(binary1, seq)); COMPARE_EFFECT(binary2(element1, element2), fusion::invoke_procedure(binary2, seq)); COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_ref_ctx,seq))); COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_ptr_ctx,seq))); COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_spt_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_obj_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ref_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ptr_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_spt_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_obj_c_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ref_c_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ptr_c_ctx,seq))); COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_spt_c_ctx,seq))); }