Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Nov 15, 2024
1 parent bbf1a29 commit add6c78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions include/tao/pq/parameter_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,17 +471,16 @@ namespace tao::pq
};

// default free function to detect member function to_taopq()
template< typename T >
[[nodiscard]] auto to_taopq( const T& t ) noexcept( noexcept( t.to_taopq() ) )
-> decltype( t.to_taopq() )
[[nodiscard]] auto to_taopq( const auto& t ) noexcept( noexcept( t.to_taopq() ) )
requires requires { t.to_taopq(); }
{
return t.to_taopq();
}

// default free function to detect bind<T>::to_taopq()
template< typename T >
[[nodiscard]] auto to_taopq( const T& t ) noexcept( noexcept( bind< T >::to_taopq( t ) ) )
-> decltype( bind< T >::to_taopq( t ) )
requires requires { bind< T >::to_taopq( t ); }
{
return bind< T >::to_taopq( t );
}
Expand All @@ -504,7 +503,8 @@ namespace tao::pq
} // namespace internal

template< typename T >
struct parameter_traits< T, decltype( (void)to_taopq( std::declval< const T& >() ) ) >
requires requires( const T& t ) { to_taopq( t ); }
struct parameter_traits< T >
: private internal::parameter_holder< T >,
public parameter_traits< typename internal::parameter_holder< T >::result_t >
{
Expand Down
3 changes: 2 additions & 1 deletion include/tao/pq/parameter_traits_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ namespace tao::pq
} // namespace internal

template< typename T >
struct parameter_traits< T, std::enable_if_t< is_array_parameter< T > > >
requires is_array_parameter< T >
struct parameter_traits< T >
{
private:
std::string m_data;
Expand Down

0 comments on commit add6c78

Please sign in to comment.