boost/libs/callable_traits/example/is_rvalue_reference_member.cpp
2018-01-12 21:47:58 +01:00

33 lines
941 B
C++

/*<-
Copyright (c) 2016 Barrett Adair
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/callable_traits/detail/config.hpp>
#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
int main(){ return 0; }
#else
//[ is_rvalue_reference_member
#include <type_traits>
#include <boost/callable_traits/is_rvalue_reference_member.hpp>
namespace ct = boost::callable_traits;
static_assert(ct::is_rvalue_reference_member<int()&&>::value, "");
static_assert(!ct::is_rvalue_reference_member<int()&>::value, "");
static_assert(!ct::is_rvalue_reference_member<int()>::value, "");
struct foo;
static_assert(ct::is_rvalue_reference_member<int(foo::*)()&&>::value, "");
static_assert(!ct::is_rvalue_reference_member<int(foo::*)()&>::value, "");
static_assert(!ct::is_rvalue_reference_member<int(foo::*)()>::value, "");
int main() {}
//]
#endif