Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added missing ctors and operator= #527

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/EASTL/bitvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace eastl
public:
typedef eastl_size_t size_type;
bitvector_reference(Element* ptr, eastl_size_t i);
bitvector_reference(const bitvector_reference& rhs) = default;

bitvector_reference& operator=(bool value);
bitvector_reference& operator=(const bitvector_reference& rhs);
Expand Down Expand Up @@ -112,6 +113,7 @@ namespace eastl
bitvector_const_iterator();
bitvector_const_iterator(const element_type* p, eastl_size_t i);
bitvector_const_iterator(const reference_type& referenceType);
bitvector_const_iterator(const bitvector_const_iterator& rhs) = default;

bitvector_const_iterator& operator++();
bitvector_const_iterator operator++(int);
Expand Down
13 changes: 13 additions & 0 deletions include/EASTL/deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ namespace eastl
public:
DequeIterator();
DequeIterator(const iterator& x);
DequeIterator& operator=(const iterator& x);

pointer operator->() const;
reference operator*() const;
Expand Down Expand Up @@ -924,6 +925,18 @@ namespace eastl
}


template <typename T, typename Pointer, typename Reference, unsigned kDequeSubarraySize>
typename DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::this_type&
DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::operator=(const iterator& x)
{
mpCurrent = x.mpCurrent;
mpBegin = x.mpBegin;
mpEnd = x.mpEnd;
mpCurrentArrayPtr = x.mpCurrentArrayPtr;
return *this;
}


template <typename T, typename Pointer, typename Reference, unsigned kDequeSubarraySize>
DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::DequeIterator(const iterator& x, Increment)
: mpCurrent(x.mpCurrent), mpBegin(x.mpBegin), mpEnd(x.mpEnd), mpCurrentArrayPtr(x.mpCurrentArrayPtr)
Expand Down
3 changes: 3 additions & 0 deletions include/EASTL/internal/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ namespace eastl
hashtable_iterator(const this_type_non_const& x)
: base_type(x.mpNode, x.mpBucket) { }

hashtable_iterator& operator=(const this_type_non_const& x)
{ base_type::mpNode = x.mpNode; base_type::mpBucket = x.mpBucket; return *this; }

reference operator*() const
{ return base_type::mpNode->mValue; }

Expand Down
7 changes: 5 additions & 2 deletions include/EASTL/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ namespace eastl
EA_CPP14_CONSTEXPR reverse_iterator(const reverse_iterator& ri)
: mIterator(ri.mIterator) { }

reverse_iterator& operator=(const reverse_iterator& ri) = default;

template <typename U>
EA_CPP14_CONSTEXPR reverse_iterator(const reverse_iterator<U>& ri)
: mIterator(ri.base()) { }
Expand Down Expand Up @@ -683,8 +685,7 @@ namespace eastl
public:
//back_insert_iterator(); // Not valid. Must construct with a Container.

//back_insert_iterator(const this_type& x) // Compiler-implemented
// : container(x.container) { }
back_insert_iterator(const back_insert_iterator& x) = default;

explicit back_insert_iterator(Container& x)
: container(x) { }
Expand Down Expand Up @@ -827,6 +828,8 @@ namespace eastl
insert_iterator(Container& x, iterator_type itNew)
: container(x), it(itNew) {}

insert_iterator(const insert_iterator& x) = default;

insert_iterator& operator=(const_reference value)
{
it = container.insert(it, value);
Expand Down
1 change: 1 addition & 0 deletions include/EASTL/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ namespace eastl
ListIterator() EA_NOEXCEPT;
ListIterator(const ListNodeBase* pNode) EA_NOEXCEPT;
ListIterator(const iterator& x) EA_NOEXCEPT;
ListIterator& operator=(const ListIterator&) = default;

this_type next() const EA_NOEXCEPT;
this_type prev() const EA_NOEXCEPT;
Expand Down
2 changes: 2 additions & 0 deletions include/EASTL/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ namespace Internal
{
}

TupleImpl(const TupleImpl&) = default;

template <typename OtherTuple>
TupleImpl(OtherTuple&& t)
: TupleLeaf<Indices, Ts>(eastl::forward<tuple_element_t<Indices, MakeTupleTypes_t<OtherTuple>>>(get<Indices>(t)))...
Expand Down
2 changes: 2 additions & 0 deletions include/EASTL/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,12 @@ namespace eastl
}


/* avoid defining explicit destructor to allow generating default copy-ctor/assign-op (fixes C5267 in VC2022)
///////////////////////////////////////////////////////////////////////////
// 20.7.2.2, destructor
//
~variant() = default;
*/


///////////////////////////////////////////////////////////////////////////
Expand Down