//OriginalSource: // email from Tim Moore // on 05/17/10 07:33 // in response to post: /* From: Larry Evans Newsgroups: gmane.comp.lib.boost.user Subject: [fusion]simple fusion seq_size fails to compile Date: Sun, 16 May 2010 15:43:21 -0500 */ #include #include #include template unsigned int seq_size(IterSeqE b, IterSeqE e) { return 0; } template unsigned int seq_size(IterSeqB b, IterSeqE e) { return 1 + seq_size(next(b), e); } template unsigned int seq_size(FusionSeq const& a_seq) { return seq_size(begin(a_seq), end(a_seq)); } int main() { typedef boost::fusion::list list_int_t; list_int_t list_int(0); unsigned int list_int_size = seq_size(list_int); std::cout << "list length: " << list_int_size << std::endl; }