|
Boost : |
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2007-06-13 11:48:43
In order to use the latest result_of mechanism in fusion, I updated my
working copy from cvs head a couple of hours ago.
The following example from the fusion documentation asserts, and I
experienced similiar behaviour in my code, which stopped working.
The generated string in the example is "21", not "12" as expected.
Is there something with fold() that have changed?
struct make_string
{
template<typename T, typename State>
struct result
{
typedef std::string type;
};
template<typename T>
std::string operator()(const T& t, const std::string& str) const
{
return str + boost::lexical_cast<std::string>(t);
}
};
...
const vector <file://///chrhol06/Studio8/thirdparty/boost/libs/fusion/doc/html/fusion/sequences/containers/vector.html><int,int>
vec(1,2);
assert(fold <file://///chrhol06/Studio8/thirdparty/boost/libs/fusion/doc/html/fusion/algorithms/iteration/functions/fold.html>(vec,std::string(""),
make_string()) == "12");
/ Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk