Generic Type Trait example I want to check that a some type has some methods:

using Arg_t2 = int;
using Arg_t3 = int;

template&lt;class T&gt;
struct ValidType{
   using Ret_t1 = T;
   using Arg_t1 = int;
   // ...
   Ret_t1 method1(Arg_t1,Arg_t2,Arg_t3);
   //...
};


Therefor I wrote a type-trait:

#include &lt;type_traits&gt;

template&lt;class T,class _ = void&gt; struct is_my_valid : ::std::false_type {};
template&lt;class T&gt; struct is_my_valid&lt;T,::std::enable_if_t&lt;
  ::std::is_same&lt;typename T::Ret_t1,decltype(::std::declval&lt;T&gt;().method1(::std::declval&lt;typename T::Arg_t1&gt;(),::std::declval&lt;Arg_t2&gt;(),::std::declval&lt;Arg_t3&gt;()))&gt;::value
  // &amp;&amp; ...
&gt; &gt; : ::std::true_type {}; 


We can test this with:

static_assert(is_my_valid&lt;ValidType&lt;int&gt;&gt;::value,"");


What are my options to make the definition of is_my_valid this look prettier?

Edit:
I basicly want to describe an Interface with type traits. I want to do this, because the interface includes types, that depend on template parameters.

I also like that an type does not have to be implemented using the ValidType in anyway to be valid.
Edit: Only after posting did I see that the question was tagged c++14. This code relies on std::void_t from c++17 which is trivial to implement in c++14.

You can extract some of the functionality to a reusable detect type-trait that only needs to be supplied a type alias to work.

namespace detail {

template &lt;template &lt;class...&gt; class CheckTemplate, class = void, class... Object&gt;
struct detect_impl : std::false_type {};

template &lt;template &lt;class...&gt; class CheckTemplate, class... Object&gt;
struct detect_impl&lt;CheckTemplate, std::void_t&lt;CheckTemplate&lt;Object...&gt;&gt;, Object...&gt; : std::true_type {};
}  // namespace detail

template &lt;template &lt;class...&gt; class CheckTemplate, class... Object&gt;
constexpr bool detect_v = detail::detect_impl&lt;CheckTemplate, void, Object...&gt;{};


With that in place all we need is to use it as such.

template &lt;class T&gt;
using is_valid = decltype(std::declval&lt;T&gt;().method1(0, 0, 0));

template &lt;typename T&gt;
constexpr bool is_valid_v = detect_v&lt;is_valid, T&gt;;

static_assert(is_valid_v&lt;ValidType&lt;int&gt;&gt;)


The Object pack let's us make a more flexible is_valid that takes the argument types as parameters if we want.

template &lt;class T, class... Args&gt;
using is_valid_flex = decltype(std::declval&lt;T&gt;().method1(std::declval&lt;Args&gt;()...));

template &lt;class... Args&gt;
constexpr bool is_valid_flex_v = detect_v&lt;is_valid, Args...&gt;;

static_assert(is_valid_flex_v&lt;ValidType&lt;int&gt;, int, int int&gt;);


Additional modification is possible if we want to involve the return-type of the method.