CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
linkedlist.h
1
2#pragma once
3
4#include <system/object.h>
5#include <system/string.h>
6#include <system/type_info.h>
7#include <system/shared_ptr.h>
8#include <system/exceptions.h>
9#include <system/collections/ienumerator.h>
10#include <system/collections/ienumerable.h>
11#include <system/collections/icollection.h>
12#include <system/collections/invalidatable.h>
13#include <system/array.h>
14
15#include <system/diagnostics/debug.h>
16#include <list>
17#include <unordered_map>
18
19#include <type_traits>
20
21namespace System { namespace Collections { namespace Generic {
22
24template <typename T>
25class LinkedList;
26
33template <typename T>
34class ASPOSECPP_SHARED_CLASS LinkedListNode final : public Object
35{
37 RTTI_INFO_TEMPLATE_CLASS(LinkedListNode<T>, System::BaseTypesInfo<System::Object>)
39 friend class LinkedList<T>;
41 typedef typename LinkedList<T>::iterator iterator;
42
46 LinkedListNode(const SharedPtr<LinkedList<T>>& list, const iterator& it) : m_value(*it)
47 {
48 Bind(list, it);
49 }
50 MEMBER_FUNCTION_MAKE_OBJECT(LinkedListNode, CODEPORTING_ARGS(const SharedPtr<LinkedList<T>>& list, const iterator& it), CODEPORTING_ARGS(list, it));
51
55 void Bind(const SharedPtr<LinkedList<T>>& list, const iterator& it)
56 {
57 list->m_ptr_node_map[&*it] = this;
58 m_list = list;
59 m_it = it;
60 }
61
63 void Unbind()
64 {
65 if (m_list != nullptr)
66 {
67 m_list->m_ptr_node_map.erase(&*m_it);
68 m_list = nullptr;
69 m_it = iterator();
70 }
71 }
72
74 void UnbindNode()
75 {
76 if (m_list != nullptr)
77 {
78 m_list = nullptr;
79 m_it = iterator();
80 }
81 }
82
84 iterator CopyIterator() const
85 {
86 return m_it;
87 }
88
89public:
92 LinkedListNode(const T &value) : m_value(value)
93 {}
94
98 {
99 return m_list;
100 }
101
105 {
106 if (m_list != nullptr)
107 {
108 auto next_it = ++CopyIterator();
109 if (next_it == m_list->m_data.end())
110 return nullptr;
111
112 return m_list->MakeSharedLinkedListNode(next_it);
113 }
114 else
115 return nullptr;
116 }
117
121 {
122 if (m_list != nullptr && m_it != m_list->m_data.begin())
123 return m_list->MakeSharedLinkedListNode(--CopyIterator());
124 else
125 return nullptr;
126 }
127
130 T get_Value() const
131 {
132 return m_value;
133 }
134
137 void set_Value(const T &value)
138 {
139 m_value = value;
140 if (m_list != nullptr)
141 {
142 *m_it = value;
143 }
144 }
145
146protected:
149 {
150 if (m_list != nullptr)
151 {
152 m_list->m_ptr_node_map.erase(&*m_it);
153 }
154 }
155
156#ifdef ASPOSE_GET_SHARED_MEMBERS
159 void GetSharedMembers(System::Object::shared_members_type& result) const override
160 {
161 System::Object::GetSharedMembers(result);
162
163 result.Add("System::Collections::Generic::LinkedListNode::m_list", this->m_list);
164 }
165#endif
166
167private:
169 T m_value;
173 iterator m_it;
174};
175
213template <typename T>
214class ASPOSECPP_SHARED_CLASS LinkedList : virtual public Object, public ICollection<T>, private Invalidatable
215{
217 typedef BaseTypesInfo<Object, ICollection<T>> ThisTypeBaseTypesInfo;
219 RTTI_INFO_TEMPLATE_CLASS(LinkedList<T>, ThisTypeBaseTypesInfo);
221 friend class LinkedListNode<T>;
222
224
225 ASPOSE_COLLECTION_POINTER_MODE_CONTROL(T)
226
227public:
229 typedef std::list<T, typename pointer_mode_t::allocator_type> list_t;
230
232 typedef typename list_t::iterator iterator;
234 typedef typename list_t::const_iterator const_iterator;
236 typedef typename list_t::reverse_iterator reverse_iterator;
238 typedef typename list_t::const_reverse_iterator const_reverse_iterator;
239
241 class Enumerator : virtual public Object, public IEnumerator<T>
242 {
244 typedef BaseTypesInfo<Object, IEnumerator<T>> ThisTypeBaseTypesInfo;
246 RTTI_INFO_TEMPLATE_CLASS(LinkedList<T>, ThisTypeBaseTypesInfo);
248 typedef typename LinkedList<T>::iterator iterator;
249
251 iterator m_current;
255 bool m_was_first_move;
257 bool m_was_not_reached_end;
259 InvalidatableTracker m_tracker;
260
261 public:
264 Enumerator(const SharedPtr<LinkedList<T>>& list) : m_list(list)
265 , m_was_first_move(false)
266 , m_was_not_reached_end(true), m_tracker(list.get())
267 {}
268
272 {
273 return *m_current;
274 }
275
278 bool MoveNext() override
279 {
280 if (!m_tracker.CheckValidity())
281 throw InvalidOperationException(u"Collection was modified after the enumerator was instantiated.");
282 else if (!m_was_first_move)
283 {
284 m_was_first_move = true;
285
286 if ((m_current = m_list->begin()) != m_list->end())
287 return true;
288 else
289 {
290 m_was_not_reached_end = false;
291 return false;
292 }
293 }
294 else if (m_was_not_reached_end)
295 {
296 if (++m_current != m_list->end())
297 return true;
298 else
299 {
300 m_was_not_reached_end = false;
301 return false;
302 }
303 }
304 else
305 return false;
306 }
307
308 protected:
310 ~Enumerator() override
311 {}
312
313#ifdef ASPOSE_GET_SHARED_MEMBERS
316 void GetSharedMembers(System::Object::shared_members_type& result) const override
317 {
318 System::Object::GetSharedMembers(result);
319
320 result.Add("System::Collections::Generic::LinkedList::Enumerator::m_list", this->m_list);
321 }
322#endif
323 };
324
326 LinkedList() : ASPOSE_COLLECTION_INIT_ALLOCATOR(){}
327
330 LinkedList(const SharedPtr<IEnumerable<T>>& collection) : ASPOSE_COLLECTION_INIT_ALLOCATOR()
331 {
332 if (collection == nullptr)
333 throw ArgumentNullException(u"Value cannot be null. Parameter name: collection");
334
335 for (auto enumerator = collection->GetEnumerator(); enumerator->MoveNext();)
336 {
337 m_data.emplace_back(enumerator->get_Current());
338 }
339 }
340
344 {
345 if (m_data.empty())
346 return nullptr;
347 else
348 return MakeSharedLinkedListNode(m_data.begin());
349 }
350
354 {
355 if (m_data.empty())
356 return nullptr;
357 else
358 return MakeSharedLinkedListNode(--m_data.end());
359 }
360
363 int get_Count() const override
364 {
365 return ASPOSECPP_CHECKED_CAST(int, m_data.size());
366 }
367
373 {
374 if (node == nullptr)
375 throw ArgumentNullException(u"Value cannot be null. Parameter name: node");
376
377 if (node->get_List().get() != this)
378 throw InvalidOperationException(u"The LinkedList node does not belong to current LinkedList.");
379
380 Invalidate();
381
382 auto it = m_data.emplace(++node->CopyIterator(), element);
384 }
385
390 {
391 if (node == nullptr)
392 throw ArgumentNullException(u"Value cannot be null. Parameter name: node");
393
394 if (newNode == nullptr)
395 throw ArgumentNullException(u"Value cannot be null. Parameter name: newNode");
396
397 if (node->m_list.get() != this)
398 throw InvalidOperationException(u"The LinkedList node does not belong to current LinkedList.");
399
400 if (newNode->m_list != nullptr)
401 throw InvalidOperationException(u"The LinkedList node already belongs to a LinkedList.");
402
403 Invalidate();
404
405 auto it = m_data.emplace(++node->CopyIterator(), newNode->m_value);
406 newNode->Bind(MakeSharedPtr(this), it);
407 }
408
414 {
415 if (node == nullptr)
416 throw ArgumentNullException(u"Value cannot be null. Parameter name: node");
417
418 if (node->get_List().get() != this)
419 throw InvalidOperationException(u"The LinkedList node does not belong to current LinkedList.");
420
421 Invalidate();
422
423 auto it = m_data.emplace(node->m_it, element);
425 }
426
431 {
432 if (node == nullptr)
433 throw ArgumentNullException(u"Value cannot be null. Parameter name: node");
434
435 if (newNode == nullptr)
436 throw ArgumentNullException(u"Value cannot be null. Parameter name: newNode");
437
438 if (node->m_list.get() != this)
439 throw InvalidOperationException(u"The LinkedList node does not belong to current LinkedList.");
440
441 if (newNode->m_list != nullptr)
442 throw InvalidOperationException(u"The LinkedList node already belongs to a LinkedList.");
443
444 Invalidate();
445
446 auto it = m_data.emplace(node->m_it, newNode->m_value);
447 newNode->Bind(MakeSharedPtr(this), it);
448 }
449
454 {
455 Invalidate();
456
457 auto it = m_data.emplace(m_data.begin(), element);
459 }
460
464 {
465 if (newNode == nullptr)
466 throw ArgumentNullException(u"Value cannot be null. Parameter name: newNode");
467
468 if (newNode->m_list != nullptr)
469 throw InvalidOperationException(u"The LinkedList node already belongs to a LinkedList.");
470
471 Invalidate();
472
473 auto it = m_data.emplace(m_data.begin(), newNode->m_value);
474 newNode->Bind(MakeSharedPtr(this), it);
475 }
476
481 {
482 Invalidate();
483
484 auto it = m_data.emplace(m_data.end(), element);
486 }
487
490 void AddLast(const SharedPtr<LinkedListNode<T>>& newNode)
491 {
492 if (newNode == nullptr)
493 throw ArgumentNullException(u"Value cannot be null. Parameter name: newNode");
494
495 if (newNode->m_list != nullptr)
496 throw InvalidOperationException(u"The LinkedList node already belongs to a LinkedList.");
497
498 Invalidate();
499
500 auto it = m_data.emplace(m_data.end(), newNode->m_value);
501 newNode->Bind(MakeSharedPtr(this), it);
502 }
503
506 void Add(const T& element) override
507 {
508 AddLast(element);
509 }
510
512 void Clear() override
513 {
514 Invalidate();
515
516 std::for_each(m_ptr_node_map.begin(), m_ptr_node_map.end(),
517 [](const std::pair<const T*, LinkedListNode<T>*>& it_node_pair) {
518 it_node_pair.second->UnbindNode();
519 });
520 m_ptr_node_map.clear();
521 m_data.clear();
522 }
523
527 bool Contains(const T& element) const override
528 {
529 return std::find(m_data.begin(), m_data.end(), element) != m_data.end();
530 }
531
535 void CopyTo(ArrayPtr<T> array, int index) override
536 {
537 if (array == nullptr)
538 throw ArgumentNullException(u"Value cannot be null. Parameter name: array");
539
540 if (index < 0)
541 throw ArgumentOutOfRangeException(u"Index is out of range. Parameter name: index");
542
543 if (array->get_Count() - index < get_Count())
544 throw ArgumentException(u"Insufficient space in the target location to copy the information.");
545
546 std::copy(m_data.begin(), m_data.end(), array.begin() + index);
547 }
548
552 SharedPtr<LinkedListNode<T>> Find(const T& element) const
553 {
554 auto it = std::find(m_data.begin(), m_data.end(), element);
555 if (it == m_data.end())
556 return nullptr;
557 else
558 return MakeSharedLinkedListNode(it);
559 }
560
564 SharedPtr<LinkedListNode<T>> FindLast(const T& element) const
565 {
566 auto rit = std::find(m_data.rbegin(), m_data.rend(), element);
567 if (rit == m_data.rend())
568 return nullptr;
569 else
570 return MakeSharedLinkedListNode(--rit.base());
571 }
572
576 {
577 return MakeObject<Enumerator>(MakeSharedPtr(this));
578 }
579
583 bool Remove(const T& element) override
584 {
585 auto it = std::find(m_data.begin(), m_data.end(), element);
586 if (it == m_data.end())
587 return false;
588 else
589 {
590 Invalidate();
591
592 auto ptr_node_it = m_ptr_node_map.find(&*it);
593 if (ptr_node_it != m_ptr_node_map.end())
594 {
595 ptr_node_it->second->Unbind();
596 }
597
598 m_data.erase(it);
599 return true;
600 }
601 }
602
606 {
607 if (node == nullptr)
608 throw ArgumentNullException(u"Value cannot be null. Parameter name: node");
609
610 if (node->m_list.get() != this)
611 throw InvalidOperationException(u"The LinkedList node does not belong to current LinkedList.");
612
613 Invalidate();
614
615 auto it = node->m_it;
616 node->Unbind();
617 m_data.erase(it);
618 }
619
623 {
624 if (m_data.empty())
625 throw InvalidOperationException(u"The LinkedList is empty.");
626
627 Invalidate();
628
629 auto ptr_node_it = m_ptr_node_map.find(&*m_data.begin());
630 if (ptr_node_it != m_ptr_node_map.end())
631 {
632 ptr_node_it->second->Unbind();
633 }
634
635 m_data.pop_front();
636 }
637
641 {
642 if (m_data.empty())
643 throw InvalidOperationException(u"The LinkedList is empty.");
644
645 Invalidate();
646
647 auto ptr_node_it = m_ptr_node_map.find(&*--m_data.end());
648 if (ptr_node_it != m_ptr_node_map.end())
649 {
650 ptr_node_it->second->Unbind();
651 }
652
653 m_data.pop_back();
654 }
655
658 iterator begin() noexcept
659 {
660 return m_data.begin();
661 }
664 iterator end() noexcept
665 {
666 return m_data.end();
667 }
668
671 const_iterator begin() const noexcept
672 {
673 return m_data.begin();
674 }
678 const_iterator end() const noexcept
679 {
680 return m_data.end();
681 }
682
685 const_iterator cbegin() const noexcept
686 {
687 return m_data.cbegin();
688 }
692 const_iterator cend() const noexcept
693 {
694 return m_data.cend();
695 }
696
700 {
701 return m_data.rbegin();
702 }
707 {
708 return m_data.rend();
709 }
710
714 {
715 return m_data.rbegin();
716 }
721 {
722 return m_data.rend();
723 }
724
728 {
729 return m_data.crbegin();
730 }
735 {
736 return m_data.crend();
737 }
738
740 System::Details::VirtualizedIteratorBase<T>* virtualizeBeginIterator() override
741 {
742 return new System::Details::NativeIteratorWrapper<T, iterator>(begin(), end());
743 }
745 System::Details::VirtualizedIteratorBase<T>* virtualizeEndIterator() override
746 {
747 return new System::Details::NativeIteratorWrapper<T, iterator>(end(), end());
748 }
750 System::Details::VirtualizedIteratorBase<T>* virtualizeBeginConstIterator() const override
751 {
752 return new System::Details::NativeConstIteratorWrapper<T, const_iterator>(begin(), end());
753 }
755 System::Details::VirtualizedIteratorBase<T>* virtualizeEndConstIterator() const override
756 {
757 return new System::Details::NativeConstIteratorWrapper<T, const_iterator>(end(), end());
758 }
759
760#ifdef __DBG_FOR_EACH_MEMBER
763 void DBG_for_each_member(DBG::for_each_member_visitor& visitor) const override
764 {
765 visitor.add_self(this);
766 DBG::for_each_of_Object(this, m_data, visitor);
767 }
768
771 const char* DBG_class_name() const override { return "LinkedList<T>"; }
772#endif
773
774protected:
776 ~LinkedList() override
777 {}
778
779#ifdef ASPOSE_GET_SHARED_MEMBERS
780 DEFINE_GET_SHARED_MEMBERS(m_data)
781#endif
782
783private:
786 SharedPtr<LinkedListNode<T>> MakeSharedLinkedListNode(iterator it) const
787 {
788 auto ptr_node_it = m_ptr_node_map.find(&*it);
789 if (ptr_node_it != m_ptr_node_map.end())
790 return MakeSharedPtr(ptr_node_it->second);
791 else
793 }
794
796 mutable list_t m_data;
799 std::unordered_map<const T*, LinkedListNode<T>*> m_ptr_node_map;
800};
801
802}}} // namespace System::Collections::Generic
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: icollection.h:20
Interface of object providing enumerator on contained elements.
Definition: ienumerable.h:25
System::Details::VirtualizedConstIterator< T > const_iterator
Const iterator type.
Definition: ienumerable.h:216
System::Details::VirtualizedIterator< T > iterator
Iterator type.
Definition: ienumerable.h:214
Interface of enumerator which can be used to iterate through some elements. Objects of this class sho...
Definition: ienumerator.h:63
Enumerator to iterate through linked list.
Definition: linkedlist.h:242
MakeConstRef_t< T > get_Current() const override
Gets current element.
Definition: linkedlist.h:271
Enumerator(const SharedPtr< LinkedList< T > > &list)
Creates enumerator.
Definition: linkedlist.h:264
~Enumerator() override
Destructor.
Definition: linkedlist.h:310
bool MoveNext() override
Points enumerator to the next element (if any).
Definition: linkedlist.h:278
LinkedList forward declaration.
Definition: linkedlist.h:215
~LinkedList() override
Destructor.
Definition: linkedlist.h:776
void CopyTo(ArrayPtr< T > array, int index) override
Copies container data into existing array elements.
Definition: linkedlist.h:535
reverse_iterator rbegin() noexcept
Gets a reverse iterator to the last element of collection (first in reverse).
Definition: linkedlist.h:699
SharedPtr< LinkedListNode< T > > get_Last() const
Gets pointer to the last element in the list.
Definition: linkedlist.h:353
void RemoveLast()
Removes last node from list.
Definition: linkedlist.h:640
LinkedList()
Creates empty LinkedList.
Definition: linkedlist.h:326
System::Details::VirtualizedIteratorBase< T > * virtualizeBeginConstIterator() const override
Gets the implementation of begin const iterator for the current container.
Definition: linkedlist.h:750
SharedPtr< LinkedListNode< T > > FindLast(const T &element) const
Performs reverse direction find of an element in the list.
Definition: linkedlist.h:564
void Add(const T &element) override
Adds element to the end of the list.
Definition: linkedlist.h:506
void AddLast(const SharedPtr< LinkedListNode< T > > &newNode)
Adds newNode to the end of the list.
Definition: linkedlist.h:490
const_reverse_iterator crend() const noexcept
Gets a reverse iterator for a non-existent const-qualified element before the start of the collection...
Definition: linkedlist.h:734
LinkedList(const SharedPtr< IEnumerable< T > > &collection)
Copy constructor.
Definition: linkedlist.h:330
SharedPtr< LinkedListNode< T > > AddFirst(const T &element)
Adds element to the beginning of the list.
Definition: linkedlist.h:453
list_t::iterator iterator
Iterator type.
Definition: linkedlist.h:232
SharedPtr< IEnumerator< T > > GetEnumerator() override
Gets enumerator to iterate through current LinkedList.
Definition: linkedlist.h:575
System::Details::VirtualizedIteratorBase< T > * virtualizeBeginIterator() override
Gets the implementation of begin iterator for the current container.
Definition: linkedlist.h:740
const_reverse_iterator crbegin() const noexcept
Gets a reverse iterator to the last const-qualified element of collection (first in reverse).
Definition: linkedlist.h:727
int get_Count() const override
Gets number of elements in list.
Definition: linkedlist.h:363
reverse_iterator rend() noexcept
Gets a reverse iterator for a non-existent element before the start of the collection.
Definition: linkedlist.h:706
const_reverse_iterator rend() const noexcept
Gets a reverse iterator for a non-existent element before the start of the const-qualified collection...
Definition: linkedlist.h:720
const_iterator begin() const noexcept
Gets iterator to the first element of the const-qualified collection.
Definition: linkedlist.h:671
const_iterator cend() const noexcept
Gets iterator for a non-existent const-qualified element behind the end of the collection.
Definition: linkedlist.h:692
list_t::const_iterator const_iterator
Const iterator type.
Definition: linkedlist.h:234
iterator begin() noexcept
Gets iterator to the first element of collection.
Definition: linkedlist.h:658
const_reverse_iterator rbegin() const noexcept
Gets a reverse iterator to the last element of the const-qualified collection (first in reverse).
Definition: linkedlist.h:713
list_t::reverse_iterator reverse_iterator
Reverse iterator type.
Definition: linkedlist.h:236
SharedPtr< LinkedListNode< T > > get_First() const
Gets pointer to the first element in the list.
Definition: linkedlist.h:343
const_iterator cbegin() const noexcept
Gets iterator to the first const-qualified element of collection.
Definition: linkedlist.h:685
void AddFirst(const SharedPtr< LinkedListNode< T > > &newNode)
Adds newNode to the beginning of the list.
Definition: linkedlist.h:463
bool Contains(const T &element) const override
Checks if element is present in list.
Definition: linkedlist.h:527
std::list< T, typename pointer_mode_t::allocator_type > list_t
Underlying data type.
Definition: linkedlist.h:229
SharedPtr< LinkedListNode< T > > Find(const T &element) const
Performs forward direction find of an element in the list.
Definition: linkedlist.h:552
SharedPtr< LinkedListNode< T > > AddLast(const T &element)
Adds element to the end of the list.
Definition: linkedlist.h:480
const_iterator end() const noexcept
Gets iterator for a non-existent element behind the end of the const-qualified collection.
Definition: linkedlist.h:678
void AddAfter(const SharedPtr< LinkedListNode< T > > &node, const SharedPtr< LinkedListNode< T > > &newNode)
Adds newNode after node of the list.
Definition: linkedlist.h:389
void RemoveFirst()
Removes first node from list.
Definition: linkedlist.h:622
void Remove(const SharedPtr< LinkedListNode< T > > &node)
Removes node from list.
Definition: linkedlist.h:605
System::Details::VirtualizedIteratorBase< T > * virtualizeEndConstIterator() const override
Gets the implementation of end const iterator for the current container.
Definition: linkedlist.h:755
iterator end() noexcept
Gets iterator for a non-existent element behind the end of the collection.
Definition: linkedlist.h:664
SharedPtr< LinkedListNode< T > > AddBefore(const SharedPtr< LinkedListNode< T > > &node, const T &element)
Adds element before node of the list.
Definition: linkedlist.h:413
System::Details::VirtualizedIteratorBase< T > * virtualizeEndIterator() override
Gets the implementation of end iterator for the current container.
Definition: linkedlist.h:745
void Clear() override
Deletes all elements in list.
Definition: linkedlist.h:512
void AddBefore(const SharedPtr< LinkedListNode< T > > &node, const SharedPtr< LinkedListNode< T > > &newNode)
Adds newNode before node of the list.
Definition: linkedlist.h:430
list_t::const_reverse_iterator const_reverse_iterator
Const reverse iterator type.
Definition: linkedlist.h:238
SharedPtr< LinkedListNode< T > > AddAfter(const SharedPtr< LinkedListNode< T > > &node, const T &element)
Adds element after node of the list.
Definition: linkedlist.h:372
bool Remove(const T &element) override
Removes first occurance of the specified element from list.
Definition: linkedlist.h:583
Node of linked list. Implements a wrapper over an iterator of std::list that is wrapped in linked lis...
Definition: linkedlist.h:35
~LinkedListNode() override
Destructor.
Definition: linkedlist.h:148
LinkedListNode(const T &value)
Constructor.
Definition: linkedlist.h:92
T get_Value() const
Gets stored value.
Definition: linkedlist.h:130
SharedPtr< LinkedListNode< T > > get_Next() const
Gets next node.
Definition: linkedlist.h:104
void set_Value(const T &value)
Sets stored value.
Definition: linkedlist.h:137
SharedPtr< LinkedListNode< T > > get_Previous() const
Gets previous node.
Definition: linkedlist.h:120
SharedPtr< LinkedList< T > > get_List() const
Gets containing list.
Definition: linkedlist.h:97
Class that makes it possible to track the state of its descendants through InvalidatableTracker objec...
Definition: invalidatable.h:12
void Invalidate()
Changes the current state, invalidating all previously created trackers.
Class that implements trackers of Invalidatable objects.
Definition: invalidatable.h:32
bool CheckValidity() const
Checks if the state of the tracked object has changed.
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
auto end() -> decltype(std::declval< Q >().end())
Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization ty...
Definition: smart_ptr.h:838
auto begin() -> decltype(std::declval< Q >().begin())
Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization ...
Definition: smart_ptr.h:830
Definition: db_command.h:9
SmartPtr< X > MakeSharedPtr(X *p)
Converts raw pointer to smart pointer.
Definition: smart_ptr.h:1650
typename MakeConstRef< T >::type MakeConstRef_t
Helper type for MakeConstRef modifier.
Definition: make_const_ref.h:20