Hi.
I just upgraded my Boost from 1.55 to 1.58. My project doesn't build
anymore, it fails on the following pattern, which used to work with 1.55:
---<snip>---
#include <algorithm>
#include
#include <string>
#include <iostream>
#include <vector>
struct visitor : boost::static_visitor {
result_type operator() (int) { return std::cout; }
result_type operator() (std::string) const { return std::cout; }
};
int main() {
std::vector< boost::variant > v;
visitor vis;
foreach(v.begin(), v.end(), boost::apply_visitor(vis));
return 0;
}
---<snip>---
The example is a bit silly, since foreach discards the return value of
apply_visitor anyway. So my solution was to change the visitor to
define result_type as void. This works. However, I am wondering why
delayed_visitor does no longer work in this situation? Is it because I
am trying to return a reference?
--
CYa,
⡍⠁⠗⠊⠕