On Monday, December 10, 2012, Howard Hinnant wrote: > On Dec 10, 2012, at 2:50 AM, Saleem Abdulrasool > <[email protected]<javascript:;>> > wrote: > > > Use the _LIBCPP_CONSTEXPR macro to allow the preprocessor to determine if > > constexpr should be applied to the constructor. This is required to > unify the > > constructor definition. > > > > Unify the constructor declarations, moving the member variable > initialisation > > into the initialiser-list. This requires an ugly C-style cast to ensure > > portability across all implementations. > PTHREAD_{MUTEX,COND}_INITIALIZER may be > > an aggregate initialiser, which requires an explicit type conversion for > the > > compound literal. > > > > http://llvm-reviews.chandlerc.com/D194 > > > > Files: > > include/__mutex_base > > > > Index: include/__mutex_base > > =================================================================== > > --- include/__mutex_base > > +++ include/__mutex_base > > @@ -37,13 +37,9 @@ > > pthread_mutex_t __m_; > > > > public: > > - _LIBCPP_INLINE_VISIBILITY > > -#ifndef _LIBCPP_HAS_NO_CONSTEXPR > > - constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} > > -#else > > - mutex() _NOEXCEPT {__m_ = > (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} > > -#endif > > - ~mutex(); > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR mutex() _NOEXCEPT > > + : __m_((pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER) {} > > + ~mutex(); > > > > private: > > mutex(const mutex&);// = delete; > > @@ -303,12 +299,8 @@ > > { > > pthread_cond_t __cv_; > > public: > > - _LIBCPP_INLINE_VISIBILITY > > -#ifndef _LIBCPP_HAS_NO_CONSTEXPR > > - constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {} > > -#else > > - condition_variable() {__cv_ = > (pthread_cond_t)PTHREAD_COND_INITIALIZER;} > > -#endif > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR condition_variable() > > + : __cv_((pthread_cond_t)PTHREAD_COND_INITIALIZER) {} > > ~condition_variable(); > > > > private: > > <D194.1.patch>_______________________________________________ > > cfe-commits mailing list > > [email protected] <javascript:;> > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > Is this change just for stylistic reasons, or is it required to get > something working?
It is simply a stylistic/cleanup change. There should be no change in functionality. > Howard > > -- Saleem Abdulrasool compnerd (at) compnerd (dot) org
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
