1 // Copyright (c) 2017-2019 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"
12 struct some_user_provided_visitor_for_lvalues
: boost::static_visitor
<void> {
13 void operator()(foo
& ) const {}
14 void operator()(int ) const {}
19 some_user_provided_visitor_for_lvalues(),
20 boost::variant
<int, foo
>(foo())
24 # if __GNUC__ < 5 && __GNUC_MINOR__ < 8
25 # error This test does not pass on GCC < 4.8 because of the incomplete C++11 support
30 # error Temporaries/rvalues could bind to non-const lvalues on MSVC compilers