
-----Original Message----- From: spirit-devel-bounces@lists.sourceforge.net [mailto:spirit-devel- bounces@lists.sourceforge.net] On Behalf Of Joel de Guzman Sent: Monday, September 24, 2007 1:18 AM To: spirit-devel@lists.sourceforge.net Cc: boost@lists.boost.org Subject: Re: [Spirit-devel] [fusion] Short-circuited Exception-based ViewIteration
Dean Michael Berris wrote:
This makes sense, though there might be a possibility where a homogeneous tuple would be able to return just a single value:
struct equals_2 { template <typename T> T operator() (T element) const { if (element == 2) return element; }; };
typedef fusion::tuple<int, int, int> point_type; point_type point(1, 2, 3); assert(fusion::is_homogenous<point_type>::value == true); assert(fusion::find_first_if<equals_2>(point) == 2); // only works
if
'point' is a homogeneous container
If that was the case, I'd use boost::array which is a nice data structure that has a special property: it is *both* a fusion sequence *and* an stl sequence.
Brilliant! I think that solves my predicament! :D
Regards,
Thank you very much! -- Dean Michael Berris <dmberris@friendster.com> Mobile: +639287291459 YMID: mikhailberis