]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hof/example/static_if.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 /*=============================================================================
8 Copyright (c) 2016 Paul Fultz II
10 Distributed under the Boost Software License, Version 1.0. (See accompanying
11 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 ==============================================================================*/
16 using namespace boost::hof
;
18 // static_if example taken from Baptiste Wicht:
19 // http://baptiste-wicht.com/posts/2015/07/simulate-static_if-with-c11c14.html
22 void decrement_kindof(T
& value
)
25 if_(std::is_same
<std::string
, T
>())([&](auto id
){
36 std::string s
= "hello!";