View | Details | Raw Unified | Return to bug 2942
Collapse All | Expand All

(-)a/src/core/model/default-deleter.h (-1 / +1 lines)
 Lines 50-56    Link Here 
50
   * \tparam T \deduced The object type being deleted.
50
   * \tparam T \deduced The object type being deleted.
51
   * \param [in] object The object to delete.
51
   * \param [in] object The object to delete.
52
   */
52
   */
53
  inline static void Delete (T *object) {
53
  inline static void Delete (T *object) noexcept {
54
    delete object;
54
    delete object;
55
  }
55
  }
56
};
56
};
(-)a/src/core/model/ptr.h (+31 lines)
 Lines 145-150    Link Here 
145
   */
145
   */
146
  Ptr (Ptr const&o);
146
  Ptr (Ptr const&o);
147
  /**
147
  /**
148
   * Move the other Ptr into this new Ptr.
149
   * This new Ptr now owns the object and the previous instance
150
   * will no longer contain an underlying object.
151
   *
152
   * \param [in] o The other Ptr instance.
153
   */
154
  Ptr (Ptr &&o) noexcept;
155
  /**
148
   * Copy, removing \c const qualifier.
156
   * Copy, removing \c const qualifier.
149
   *
157
   *
150
   * \tparam U \deduced The underlying type of the \c const object.
158
   * \tparam U \deduced The underlying type of the \c const object.
 Lines 162-167    Link Here 
162
   */
170
   */
163
  Ptr<T> &operator = (Ptr const& o);
171
  Ptr<T> &operator = (Ptr const& o);
164
  /**
172
  /**
173
   * Assignment operator by moving the underlying object.
174
   * The other Ptr will no longer reference an object.
175
   *
176
   * \param [in] o The other Ptr instance.
177
   * \return A reference to self.
178
   */
179
  Ptr<T> &operator = (Ptr && o) noexcept;
180
  /**
165
   * An rvalue member access.
181
   * An rvalue member access.
166
   * \returns A pointer to the underlying object.
182
   * \returns A pointer to the underlying object.
167
   */
183
   */
 Lines 743-748    Link Here 
743
  Acquire ();
759
  Acquire ();
744
}
760
}
745
template <typename T>
761
template <typename T>
762
Ptr<T>::Ptr (Ptr &&o) noexcept
763
  : m_ptr (o.m_ptr)
764
{
765
  o.m_ptr = nullptr;
766
}
767
template <typename T>
746
template <typename U>
768
template <typename U>
747
Ptr<T>::Ptr (Ptr<U> const &o)
769
Ptr<T>::Ptr (Ptr<U> const &o)
748
  : m_ptr (PeekPointer (o))
770
  : m_ptr (PeekPointer (o))
 Lines 777-782    Link Here 
777
}
799
}
778
800
779
template <typename T>
801
template <typename T>
802
Ptr<T> &
803
Ptr<T>::operator = (Ptr && o) noexcept
804
{
805
  Ptr p(std::move(o));
806
  std::swap(p.m_ptr, this->m_ptr);
807
  return *this;
808
}
809
810
template <typename T>
780
T *
811
T *
781
Ptr<T>::operator -> () 
812
Ptr<T>::operator -> () 
782
{
813
{
(-)a/src/core/model/simple-ref-count.h (-1 / +1 lines)
 Lines 113-119    Link Here 
113
   * conjunction with the Ptr template which would make calling Ref
113
   * conjunction with the Ptr template which would make calling Ref
114
   * unnecessary and dangerous.
114
   * unnecessary and dangerous.
115
   */
115
   */
116
  inline void Unref (void) const
116
  inline void Unref (void) const noexcept
117
  {
117
  {
118
    m_count--;
118
    m_count--;
119
    if (m_count == 0)
119
    if (m_count == 0)

Return to bug 2942