1 // Copyright (c) 2017 Antony Polukhin
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #include "boost/config.hpp"
8 #include "boost/variant.hpp"
11 struct some_user_provided_visitor_for_lvalues
: boost::static_visitor
<void> {
12 void operator()(std::string
& ) const {}
13 void operator()(int ) const {}
18 some_user_provided_visitor_for_lvalues(),
19 boost::variant
<int, std::string
>("Hello")
23 # error Temporaries/rvalues could bind to non-const lvalues on MSVC compilers