Remove some superflous typedefs and default impls

This commit is contained in:
Alexander Grund 2020-07-14 21:23:30 +02:00
parent d9f9fce6fc
commit 476c1a7831
No known key found for this signature in database
GPG key ID: AA48A0760367A42B
4 changed files with 5 additions and 34 deletions

View file

@ -112,17 +112,9 @@ namespace detail
, lock_( m ) , lock_( m )
{} {}
wrapper(const wrapper&) = delete; wrapper(const wrapper&) = delete;
wrapper( wrapper&& x ) wrapper( wrapper&& x ) = default;
: base_type( x )
, lock_( std::move( x.lock_) )
{}
wrapper& operator=(const wrapper&) = delete; wrapper& operator=(const wrapper&) = delete;
wrapper& operator=( wrapper&& x ) wrapper& operator=( wrapper&& x ) = default;
{
static_cast< base_type& >( *this ) = x;
lock_ = std::move( x.lock_ );
return *this;
}
wrapper& once() wrapper& once()
{ {
this->e_->invoke( std::make_unique< detail::once >() ); this->e_->invoke( std::make_unique< detail::once >() );

View file

@ -21,15 +21,6 @@ namespace detail
BOOST_PP_ENUM_TRAILING_PARAMS(MOCK_NUM_ARGS, typename T) > BOOST_PP_ENUM_TRAILING_PARAMS(MOCK_NUM_ARGS, typename T) >
class function< R ( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) ) > class function< R ( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) ) >
{ {
public:
typedef R result_type;
template< typename Args >
struct sig
{
typedef R type;
};
private: private:
typedef function_impl< typedef function_impl<
R ( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) ) R ( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) )

View file

@ -48,19 +48,9 @@ namespace detail
m_->unlock(); m_->unlock();
} }
lock( const lock& ) = delete; lock( const lock& ) = delete;
lock( lock&& x ) lock( lock&& x ) = default;
: m_( x.m_ )
{
// Explicit reset to avoid unlock in destructor
x.m_.reset();
}
lock& operator=( const lock& ) = delete; lock& operator=( const lock& ) = delete;
lock& operator=( lock&& x ) lock& operator=( lock&& x ) = default;
{
m_ = x.m_;
x.m_.reset();
return *this;
}
private: private:
std::shared_ptr< mutex > m_; std::shared_ptr< mutex > m_;

View file

@ -54,9 +54,7 @@ namespace detail
} }
private: private:
typedef std::vector< void* > elements_type; std::vector< void* > elements_;
elements_type elements_;
const std::shared_ptr< mutex > mutex_; const std::shared_ptr< mutex > mutex_;
}; };
} }