summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-03 17:59:20 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-11-03 17:59:20 -0200
commit137dd4864d07e6c3398f049377bdeb140063d631 (patch)
treeb05ac8f95f9d24ce75951670ceb6cee0f534c3b7 /src/bindings
parent4fa4be2b14149483fa7aa58b6d0c6e3bf4ed542d (diff)
eina-cxx: eolian-cxx: Fix correct usage of is_eolian_object traits
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/cxx/eina_cxx/eina_accessor.hh8
-rw-r--r--src/bindings/cxx/eina_cxx/eina_array.hh4
-rw-r--r--src/bindings/cxx/eina_cxx/eina_deleter.hh6
-rw-r--r--src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh22
-rw-r--r--src/bindings/cxx/eina_cxx/eina_iterator.hh6
-rw-r--r--src/bindings/cxx/eina_cxx/eina_list.hh4
-rw-r--r--src/bindings/cxx/eina_cxx/eina_ptrlist.hh9
-rw-r--r--src/bindings/cxx/eina_cxx/eina_type_traits.hh4
-rw-r--r--src/bindings/cxx/eina_cxx/eina_workarounds.hh100
-rw-r--r--src/bindings/cxx/eo_cxx/eo_cxx_interop.hh7
10 files changed, 83 insertions, 87 deletions
diff --git a/src/bindings/cxx/eina_cxx/eina_accessor.hh b/src/bindings/cxx/eina_cxx/eina_accessor.hh
index 58c0b98..4aefc51 100644
--- a/src/bindings/cxx/eina_cxx/eina_accessor.hh
+++ b/src/bindings/cxx/eina_cxx/eina_accessor.hh
@@ -165,7 +165,7 @@ template <typename T, typename Enable = T>
165struct accessor; 165struct accessor;
166 166
167template <typename T> 167template <typename T>
168struct accessor<T, typename std::enable_if< ! std::is_base_of<::efl::eo::concrete, T>::value, T>::type> 168struct accessor<T, typename std::enable_if< ! ::efl::eo::is_eolian_object<T>::value, T>::type>
169 : accessor_common_base<T> 169 : accessor_common_base<T>
170{ 170{
171 typedef accessor_common_base<T> _base_type; 171 typedef accessor_common_base<T> _base_type;
@@ -277,7 +277,7 @@ struct accessor<T, typename std::enable_if< ! std::is_base_of<::efl::eo::concret
277}; 277};
278 278
279template <typename T> 279template <typename T>
280struct accessor<T, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value, T>::type> 280struct accessor<T, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value, T>::type>
281 : accessor_common_base<T> 281 : accessor_common_base<T>
282{ 282{
283 typedef accessor_common_base<T> _base_type; 283 typedef accessor_common_base<T> _base_type;
@@ -419,7 +419,7 @@ struct accessor_iterator;
419 * Random access iterator for <tt>eina::accessor</tt>. 419 * Random access iterator for <tt>eina::accessor</tt>.
420 */ 420 */
421template <typename T> 421template <typename T>
422struct accessor_iterator<T, typename std::enable_if< ! std::is_base_of<::efl::eo::concrete, T>::value, T>::type> 422struct accessor_iterator<T, typename std::enable_if< ! ::efl::eo::is_eolian_object<T>::value, T>::type>
423{ 423{
424 typedef T value_type; /**< Type of the elements. */ 424 typedef T value_type; /**< Type of the elements. */
425 typedef value_type* pointer; /**< Pointer to element type. */ 425 typedef value_type* pointer; /**< Pointer to element type. */
@@ -571,7 +571,7 @@ struct accessor_iterator<T, typename std::enable_if< ! std::is_base_of<::efl::eo
571 * Specialization for all data types that are not derivated from efl::eo::concrete. 571 * Specialization for all data types that are not derivated from efl::eo::concrete.
572 */ 572 */
573template <typename T> 573template <typename T>
574struct accessor_iterator<T, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value, T>::type> 574struct accessor_iterator<T, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value, T>::type>
575{ 575{
576 typedef T value_type; /**< Type of the elements. */ 576 typedef T value_type; /**< Type of the elements. */
577 typedef value_type* pointer; /**< Pointer to element type. */ 577 typedef value_type* pointer; /**< Pointer to element type. */
diff --git a/src/bindings/cxx/eina_cxx/eina_array.hh b/src/bindings/cxx/eina_cxx/eina_array.hh
index f9677a2..0c9bd59 100644
--- a/src/bindings/cxx/eina_cxx/eina_array.hh
+++ b/src/bindings/cxx/eina_cxx/eina_array.hh
@@ -230,7 +230,7 @@ struct _eo_array_access_traits : _ptr_array_access_traits
230}; 230};
231 231
232template <typename T, typename CloneAllocator> 232template <typename T, typename CloneAllocator>
233class array<T, CloneAllocator, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value>::type> 233class array<T, CloneAllocator, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value>::type>
234 : ptr_array<Eo, typename std::conditional 234 : ptr_array<Eo, typename std::conditional
235 <std::is_same<CloneAllocator, default_clone_allocator_placeholder>::value 235 <std::is_same<CloneAllocator, default_clone_allocator_placeholder>::value
236 , eo_clone_allocator, CloneAllocator>::type> 236 , eo_clone_allocator, CloneAllocator>::type>
@@ -497,7 +497,7 @@ public:
497}; 497};
498 498
499template <typename T> 499template <typename T>
500class range_array<T, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value>::type> 500class range_array<T, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value>::type>
501 : range_ptr_array<Eo> 501 : range_ptr_array<Eo>
502{ 502{
503 typedef range_ptr_array<Eo> _base_type; 503 typedef range_ptr_array<Eo> _base_type;
diff --git a/src/bindings/cxx/eina_cxx/eina_deleter.hh b/src/bindings/cxx/eina_cxx/eina_deleter.hh
index 65f8da0..2520f5d 100644
--- a/src/bindings/cxx/eina_cxx/eina_deleter.hh
+++ b/src/bindings/cxx/eina_cxx/eina_deleter.hh
@@ -3,6 +3,8 @@
3 3
4#include <eina_workarounds.hh> 4#include <eina_workarounds.hh>
5 5
6#include <Eina.h>
7
6namespace efl { namespace eina { 8namespace efl { namespace eina {
7 9
8struct malloc_deleter 10struct malloc_deleter
@@ -13,6 +15,10 @@ struct malloc_deleter
13 object->~T(); 15 object->~T();
14 free(object); 16 free(object);
15 } 17 }
18 void operator()(Eina_Binbuf* /*object*/) const
19 {
20 // how to free binbuf?
21 }
16}; 22};
17 23
18template <typename T> 24template <typename T>
diff --git a/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh b/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh
index 3e96e8f..13efd42 100644
--- a/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh
+++ b/src/bindings/cxx/eina_cxx/eina_eo_concrete_fwd.hh
@@ -7,27 +7,11 @@
7namespace efl { namespace eo { 7namespace efl { namespace eo {
8 8
9struct concrete; 9struct concrete;
10
11template <typename T>
12struct is_eolian_object;
10 13
11} } 14} }
12 15
13namespace std {
14template <>
15struct is_base_of< ::efl::eo::concrete, ::Eo > : std::false_type {};
16template <>
17struct is_base_of< ::efl::eo::concrete, const ::Eo > : std::false_type {};
18template <>
19struct is_base_of< ::efl::eo::concrete, volatile ::Eo > : std::false_type {};
20template <>
21struct is_base_of< ::efl::eo::concrete, const volatile ::Eo > : std::false_type {};
22
23template <>
24struct is_base_of< const ::efl::eo::concrete, ::Eo > : std::false_type {};
25template <>
26struct is_base_of< const ::efl::eo::concrete, const ::Eo > : std::false_type {};
27template <>
28struct is_base_of< const ::efl::eo::concrete, volatile ::Eo > : std::false_type {};
29template <>
30struct is_base_of< const ::efl::eo::concrete, const volatile ::Eo > : std::false_type {};
31}
32 16
33#endif 17#endif
diff --git a/src/bindings/cxx/eina_cxx/eina_iterator.hh b/src/bindings/cxx/eina_cxx/eina_iterator.hh
index 71f17ff..6fd9095 100644
--- a/src/bindings/cxx/eina_cxx/eina_iterator.hh
+++ b/src/bindings/cxx/eina_cxx/eina_iterator.hh
@@ -32,7 +32,7 @@ struct _common_iterator_base
32private: 32private:
33 typedef _common_iterator_base<T> self_type; /**< Type for the iterator instantiation itself. */ 33 typedef _common_iterator_base<T> self_type; /**< Type for the iterator instantiation itself. */
34public: 34public:
35 typedef T const value_type; /**< Type for elements returned by the iterator. */ 35 typedef typename std::remove_reference<T>::type const value_type; /**< Type for elements returned by the iterator. */
36 typedef value_type* pointer; /**< Type for a pointer to an element. */ 36 typedef value_type* pointer; /**< Type for a pointer to an element. */
37 typedef value_type& reference; /**< Type for a reference to an element. */ 37 typedef value_type& reference; /**< Type for a reference to an element. */
38 typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */ 38 typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */
@@ -148,7 +148,7 @@ protected:
148 */ 148 */
149template <typename T, typename Enable = void> 149template <typename T, typename Enable = void>
150struct iterator 150struct iterator
151 : _common_iterator_base<typename std::enable_if<!std::is_convertible<T*, ::efl::eo::concrete const* const>::value, T const>::type> 151 : _common_iterator_base<typename std::enable_if<! ::efl::eo::is_eolian_object<T>::value, T const>::type>
152{ 152{
153private: 153private:
154 typedef _common_iterator_base<T const> base_type; /**< Type for the base class. */ 154 typedef _common_iterator_base<T const> base_type; /**< Type for the base class. */
@@ -225,7 +225,7 @@ public:
225}; 225};
226 226
227template <typename T> 227template <typename T>
228struct iterator<T, typename std::enable_if<std::is_convertible<T*, ::efl::eo::concrete const* const>::value, void>::type> 228struct iterator<T, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value, void>::type>
229 : _common_iterator_base<Eo const> 229 : _common_iterator_base<Eo const>
230{ 230{
231private: 231private:
diff --git a/src/bindings/cxx/eina_cxx/eina_list.hh b/src/bindings/cxx/eina_cxx/eina_list.hh
index a47a7d7..d5b6287 100644
--- a/src/bindings/cxx/eina_cxx/eina_list.hh
+++ b/src/bindings/cxx/eina_cxx/eina_list.hh
@@ -230,7 +230,7 @@ public:
230}; 230};
231 231
232template <typename T, typename CloneAllocator> 232template <typename T, typename CloneAllocator>
233class list<T, CloneAllocator, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value>::type> 233class list<T, CloneAllocator, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value>::type>
234 : ptr_list<Eo, typename std::conditional 234 : ptr_list<Eo, typename std::conditional
235 <std::is_same<CloneAllocator, default_clone_allocator_placeholder>::value 235 <std::is_same<CloneAllocator, default_clone_allocator_placeholder>::value
236 , eo_clone_allocator, CloneAllocator>::type> 236 , eo_clone_allocator, CloneAllocator>::type>
@@ -515,7 +515,7 @@ public:
515}; 515};
516 516
517template <typename T> 517template <typename T>
518class range_list<T, typename std::enable_if<std::is_base_of<::efl::eo::concrete, T>::value>::type> 518class range_list<T, typename std::enable_if< ::efl::eo::is_eolian_object<T>::value>::type>
519 : range_ptr_list<typename std::conditional<std::is_const<T>::value, Eo const, Eo>::type> 519 : range_ptr_list<typename std::conditional<std::is_const<T>::value, Eo const, Eo>::type>
520{ 520{
521 typedef range_ptr_list<typename std::conditional<std::is_const<T>::value, Eo const, Eo>::type> _base_type; 521 typedef range_ptr_list<typename std::conditional<std::is_const<T>::value, Eo const, Eo>::type> _base_type;
diff --git a/src/bindings/cxx/eina_cxx/eina_ptrlist.hh b/src/bindings/cxx/eina_cxx/eina_ptrlist.hh
index f7254b1..03b836a 100644
--- a/src/bindings/cxx/eina_cxx/eina_ptrlist.hh
+++ b/src/bindings/cxx/eina_cxx/eina_ptrlist.hh
@@ -311,6 +311,7 @@ struct range_ptr_list : _range_template<T, _ptr_list_access_traits>
311template <typename T, typename CloneAllocator> 311template <typename T, typename CloneAllocator>
312struct _ptr_list_common_base 312struct _ptr_list_common_base
313{ 313{
314 typedef typename remove_cv<typename std::remove_reference<T>::type>::type value_type;
314 typedef CloneAllocator clone_allocator_type; /**< Type for the clone allocator. */ 315 typedef CloneAllocator clone_allocator_type; /**< Type for the clone allocator. */
315 316
316 /** 317 /**
@@ -363,7 +364,7 @@ struct _ptr_list_common_base
363 /** 364 /**
364 * @internal 365 * @internal
365 */ 366 */
366 void _delete_clone(T const* p) 367 void _delete_clone(value_type const* p)
367 { 368 {
368 _get_clone_allocator().deallocate_clone(p); 369 _get_clone_allocator().deallocate_clone(p);
369 } 370 }
@@ -371,7 +372,7 @@ struct _ptr_list_common_base
371 /** 372 /**
372 * @internal 373 * @internal
373 */ 374 */
374 T* _new_clone(typename container_value_type<T>::type const& a) 375 value_type* _new_clone(typename container_value_type<T>::type const& a)
375 { 376 {
376 return _get_clone_allocator().allocate_clone(a); 377 return _get_clone_allocator().allocate_clone(a);
377 } 378 }
@@ -420,8 +421,8 @@ public:
420 typedef value_type const& const_reference; /**< Type for a constant reference to an element. */ 421 typedef value_type const& const_reference; /**< Type for a constant reference to an element. */
421 typedef _ptr_list_iterator<value_type const> const_iterator; /**< Type for a iterator for this container. */ 422 typedef _ptr_list_iterator<value_type const> const_iterator; /**< Type for a iterator for this container. */
422 typedef _ptr_list_iterator<value_type> iterator; /**< Type for a constant iterator for this container. */ 423 typedef _ptr_list_iterator<value_type> iterator; /**< Type for a constant iterator for this container. */
423 typedef T* pointer; /**< Type for a pointer to an element. */ 424 typedef value_type* pointer; /**< Type for a pointer to an element. */
424 typedef T const* const_pointer; /**< Type for a constant pointer for an element. */ 425 typedef value_type const* const_pointer; /**< Type for a constant pointer for an element. */
425 typedef std::size_t size_type; /**< Type for size information. */ 426 typedef std::size_t size_type; /**< Type for size information. */
426 typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */ 427 typedef std::ptrdiff_t difference_type; /**< Type to represent the distance between two iterators. */
427 typedef CloneAllocator clone_allocator_type; /** Type for the clone allocator. */ 428 typedef CloneAllocator clone_allocator_type; /** Type for the clone allocator. */
diff --git a/src/bindings/cxx/eina_cxx/eina_type_traits.hh b/src/bindings/cxx/eina_cxx/eina_type_traits.hh
index ff8bfbb..3ca979f 100644
--- a/src/bindings/cxx/eina_cxx/eina_type_traits.hh
+++ b/src/bindings/cxx/eina_cxx/eina_type_traits.hh
@@ -69,7 +69,7 @@ struct container_value_type
69{ 69{
70 typedef typename std::conditional< 70 typedef typename std::conditional<
71 std::is_void<T>::value 71 std::is_void<T>::value
72 , T*, T>::type type; 72 , std::add_pointer<T>, std::remove_reference<T>>::type::type type;
73}; 73};
74 74
75template <typename T> 75template <typename T>
@@ -77,7 +77,7 @@ struct nonconst_container_value_type
77{ 77{
78 typedef typename std::conditional< 78 typedef typename std::conditional<
79 std::is_void<T>::value 79 std::is_void<T>::value
80 , T*, typename std::remove_const<T>::type>::type type; 80 , std::add_pointer<T>, std::remove_cv<typename std::remove_reference<T>::type>>::type::type type;
81}; 81};
82 82
83/** 83/**
diff --git a/src/bindings/cxx/eina_cxx/eina_workarounds.hh b/src/bindings/cxx/eina_cxx/eina_workarounds.hh
index 635bf23..0ba5869 100644
--- a/src/bindings/cxx/eina_cxx/eina_workarounds.hh
+++ b/src/bindings/cxx/eina_cxx/eina_workarounds.hh
@@ -10,62 +10,62 @@ struct _Elm_Calendar_Mark;
10struct Elm_Gen_Item; 10struct Elm_Gen_Item;
11struct _Elm_Map_Overlay; 11struct _Elm_Map_Overlay;
12 12
13namespace std { 13// namespace std {
14 14
15template <> 15// template <>
16struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; 16// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {};
17template <> 17// template <>
18struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; 18// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {};
19template <> 19// template <>
20struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; 20// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {};
21template <> 21// template <>
22struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; 22// struct is_base_of< ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {};
23 23
24template <> 24// template <>
25struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {}; 25// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark > : std::false_type {};
26template <> 26// template <>
27struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {}; 27// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const > : std::false_type {};
28template <> 28// template <>
29struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {}; 29// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark volatile > : std::false_type {};
30template <> 30// template <>
31struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {}; 31// struct is_base_of< const ::efl::eo::concrete, _Elm_Calendar_Mark const volatile > : std::false_type {};
32 32
33template <> 33// template <>
34struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; 34// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {};
35template <> 35// template <>
36struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; 36// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {};
37template <> 37// template <>
38struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; 38// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {};
39template <> 39// template <>
40struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; 40// struct is_base_of< ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {};
41 41
42template <> 42// template <>
43struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {}; 43// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item > : std::false_type {};
44template <> 44// template <>
45struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {}; 45// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const > : std::false_type {};
46template <> 46// template <>
47struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {}; 47// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item volatile > : std::false_type {};
48template <> 48// template <>
49struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {}; 49// struct is_base_of< const ::efl::eo::concrete, Elm_Gen_Item const volatile > : std::false_type {};
50 50
51template <> 51// template <>
52struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; 52// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {};
53template <> 53// template <>
54struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; 54// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {};
55template <> 55// template <>
56struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; 56// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {};
57template <> 57// template <>
58struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; 58// struct is_base_of< ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {};
59 59
60template <> 60// template <>
61struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {}; 61// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay > : std::false_type {};
62template <> 62// template <>
63struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {}; 63// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const > : std::false_type {};
64template <> 64// template <>
65struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {}; 65// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay volatile > : std::false_type {};
66template <> 66// template <>
67struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {}; 67// struct is_base_of< const ::efl::eo::concrete, _Elm_Map_Overlay const volatile > : std::false_type {};
68 68
69} 69// }
70 70
71#endif 71#endif
diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
index 0545f25..9005459 100644
--- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
+++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
@@ -85,10 +85,15 @@ struct tag
85}; 85};
86 86
87template <typename T> 87template <typename T>
88void assign_out_impl(T& lhs, T*& rhs, tag<T&, T*>) 88void assign_out_impl(T& lhs, T*& rhs, tag<T&, T*>, typename std::enable_if<!std::is_const<T>::value>::type* = 0)
89{ 89{
90 lhs = *rhs; 90 lhs = *rhs;
91} 91}
92template <typename T>
93void assign_out_impl(T const& lhs, T const*& rhs, tag<T const&, T const*>)
94{
95 const_cast<T&>(lhs) = *rhs;
96}
92inline void assign_out_impl(void*&, void*&, tag<void*, void*>) 97inline void assign_out_impl(void*&, void*&, tag<void*, void*>)
93{ 98{
94 std::abort(); // out parameter of void type? 99 std::abort(); // out parameter of void type?