Should this code fail to compile in C++17?
问题 I was updating a project to use C++17 and found a few instances where code that followed this pattern was causing a compile error on recent versions of clang: #include <boost/variant.hpp> struct vis : public boost::static_visitor<void> { void operator()(int) const { } }; int main() { boost::variant<int> v = 0; boost::apply_visitor(vis{}, v); } Using clang v8.0 in C++17 mode, this fails with the following error: <source>:11:30: error: temporary of type 'boost::static_visitor<void>' has