]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hof/test/virtual_base.cpp
1 /*=============================================================================
2 Copyright (c) 2017 Paul Fultz II
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #include <boost/hof/flip.hpp>
8 #include <boost/hof/proj.hpp>
9 #include <boost/hof/construct.hpp>
10 #include <boost/hof/pipable.hpp>
11 #include <boost/hof/rotate.hpp>
22 struct derived
: virtual base
{
23 derived() : base(1) {}
24 derived(const derived
&) : base(1) {}
25 int operator()(int i
, void *) const {
30 derived::~derived() {}
34 BOOST_HOF_TEST_CHECK(boost::hof::flip(derived())(nullptr, 2) == 2);
35 BOOST_HOF_TEST_CHECK(boost::hof::rotate(derived())(nullptr, 2) == 2);
36 BOOST_HOF_TEST_CHECK((2 | boost::hof::pipable(derived())(nullptr)) == 2);