Kaydet (Commit) fe73f209 authored tarafından Caolán McNamara's avatar Caolán McNamara

effectively expand init_header into member init list

this is all that init_header does anyway

Change-Id: If1607ab25b43bd313d2d2f1da65c20fc87ae7951
üst 46c9f1e2
...@@ -65,8 +65,9 @@ namespace sw ...@@ -65,8 +65,9 @@ namespace sw
* are alone in one. * are alone in one.
*/ */
Ring() Ring()
: pPrev(static_cast< value_type* >(this)) : pNext(static_cast< value_type* >(this))
{ algo::init_header(static_cast< value_type* >(this)); } , pPrev(static_cast< value_type* >(this))
{ }
/** /**
* Creates a new item and add it to an existing ring container. * Creates a new item and add it to an existing ring container.
* Note: the newly created item will be inserted just before item pRing. * Note: the newly created item will be inserted just before item pRing.
...@@ -120,13 +121,14 @@ namespace sw ...@@ -120,13 +121,14 @@ namespace sw
template <typename value_type> template <typename value_type>
inline Ring<value_type>::Ring( value_type* pObj ) inline Ring<value_type>::Ring( value_type* pObj )
: pPrev(static_cast< value_type* >(this)) : pNext(static_cast< value_type* >(this))
, pPrev(static_cast< value_type* >(this))
{ {
value_type* pThis = static_cast< value_type* >(this); if( pObj )
if( !pObj ) {
algo::init_header(pThis); value_type* pThis = static_cast< value_type* >(this);
else
algo::link_before(pObj, pThis); algo::link_before(pObj, pThis);
}
} }
template <typename value_type> template <typename value_type>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment