]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/variant/test/issue53.cpp
1 //-----------------------------------------------------------------------------
2 // boost-libs variant/test/issue53.cpp source file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
6 // Copyright (c) 2019-2020 Antony Polukhin
8 // Distributed under the Boost Software License, Version 1.0. (See
9 // accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 // Test case from https://github.com/boostorg/variant/issues/53
14 #include <boost/variant.hpp>
15 #include <boost/thread/lock_guard.hpp> // this line was causing problems on MSVC
17 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
25 typedef boost::variant
<spanac
, ceapa
> var_t
;
27 struct visitor_t
: public boost::static_visitor
<bool> {
28 bool operator() (const spanac
&) const {
32 bool operator() (const ceapa
&) const {
47 int main(int argc
, const char** argv
) {
50 bool result
= boost::apply_visitor(v
, get(argc
- 1));
54 #else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
58 #endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES