is_assignable.hpp
Go to the documentation of this file.
1 
2 // (C) Copyright John Maddock 2015.
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
6 //
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
8 
9 #ifndef BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
10 #define BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
11 
12 #include <cstddef> // size_t
15 
16 namespace boost{
17 
18  template <class T, class U = T> struct is_assignable;
19 
20 }
21 
22 #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
23 
26 
27 namespace boost{
28 
29  namespace detail{
30 
32  {
33  template<typename T, typename U, typename = decltype(boost::declval<T>() = boost::declval<U>())>
35 
36  template<typename, typename>
38  };
39 
40  }
41 
42  template <class T, class U> struct is_assignable : public integral_constant<bool, sizeof(detail::is_assignable_imp::test<T, U>(0)) == sizeof(boost::type_traits::yes_type)>{};
43  template <class T, std::size_t N, class U> struct is_assignable<T[N], U> : public is_assignable<T, U>{};
44  template <class T, std::size_t N, class U> struct is_assignable<T(&)[N], U> : public is_assignable<T&, U>{};
45  template <class T, class U> struct is_assignable<T[], U> : public is_assignable<T, U>{};
46  template <class T, class U> struct is_assignable<T(&)[], U> : public is_assignable<T&, U>{};
47  template <class U> struct is_assignable<void, U> : public integral_constant<bool, false>{};
48  template <class U> struct is_assignable<void const, U> : public integral_constant<bool, false>{};
49  template <class U> struct is_assignable<void volatile, U> : public integral_constant<bool, false>{};
50  template <class U> struct is_assignable<void const volatile, U> : public integral_constant<bool, false>{};
51 
52 #else
53 
56 
57 namespace boost{
58 
59  // We don't know how to implement this:
60  template <class T, class U> struct is_assignable : public integral_constant<bool, false>{};
61  template <class T, class U> struct is_assignable<T&, U> : public integral_constant<bool, is_pod<T>::value && is_pod<typename remove_reference<U>::type>::value>{};
62  template <class T, class U> struct is_assignable<const T&, U> : public integral_constant<bool, false>{};
63  template <class U> struct is_assignable<void, U> : public integral_constant<bool, false>{};
64  template <class U> struct is_assignable<void const, U> : public integral_constant<bool, false>{};
65  template <class U> struct is_assignable<void volatile, U> : public integral_constant<bool, false>{};
66  template <class U> struct is_assignable<void const volatile, U> : public integral_constant<bool, false>{};
67  /*
68  template <> struct is_assignable<void, void> : public integral_constant<bool, false>{};
69  template <> struct is_assignable<void const, void const> : public integral_constant<bool, false>{};
70  template <> struct is_assignable<void volatile, void volatile> : public integral_constant<bool, false>{};
71  template <> struct is_assignable<void const volatile, void const volatile> : public integral_constant<bool, false>{};
72  */
73 #endif
74 
75 } // namespace boost
76 
77 #endif // BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
boost::detail::is_assignable_imp
Definition: is_assignable.hpp:31
remove_reference.hpp
T
T
Definition: mem_fn_cc.hpp:25
integral_constant.hpp
boost::is_assignable
Definition: is_assignable.hpp:18
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::integral_constant< bool, ::boost::is_scalar< T >::value||::boost::is_void< T >::value||BOOST_INTERNAL_IS_POD(T)>::type
integral_constant< bool, val > type
Definition: integral_constant.hpp:56
boost::detail::is_assignable_imp::test
static boost::type_traits::yes_type test(int)
declval.hpp
yes_no_type.hpp
has_trivial_assign.hpp
boost::type_traits::yes_type
char yes_type
Definition: yes_no_type.hpp:17
workaround.hpp
boost::integral_constant
Definition: integral_constant.hpp:52
boost::integral_constant::value
static const T value
Definition: integral_constant.hpp:57
boost::type_traits::no_type
Definition: yes_no_type.hpp:18


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:40:00