template<typename T> struct S {};
template<typename T> struct R {};

template<
  typename T,
  typename V>
struct xxx;

template<
 template <class> class A,
 template <class> class B,
 typename X,
 typename Y>
struct xxx<A<X>, B<Y>> {
  static constexpr const int value = false;
};


template<
 template <class> class U,
 typename X,
 typename Y>
struct xxx<U<X>, U<Y>> {
  static constexpr const int value = true;
};

int main() {
  typedef S<double> s1;
  typedef S<int> s2;
  typedef R<int> s3;
  static_assert(xxx<s1, s2>::value,
                "No, assertion must not be raised");
  static_assert(xxx<s2, s3>::value,
                "Yes, assertion must be raised");
}