-
Notifications
You must be signed in to change notification settings - Fork 218
/
Copy pathboost_ref.cpp
32 lines (24 loc) · 1.57 KB
/
boost_ref.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
@copyright Louis Dionne 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#include <boost/hana/detail/as_container_element.hpp>
#include <boost/ref.hpp>
#include <type_traits>
namespace hana = boost::hana;
using hana::detail::as_container_element_t;
struct T { };
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T>>>{}, "");
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T> const>>{}, "");
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T>&>>{}, "");
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T> const&>>{}, "");
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T>&&>>{}, "");
static_assert(std::is_same<T&, as_container_element_t<boost::reference_wrapper<T> const&&>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const>>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const> const>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const>&>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const> const&>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const>&&>>{}, "");
static_assert(std::is_same<T const&, as_container_element_t<boost::reference_wrapper<T const> const&&>>{}, "");
int main() { }