예제 #1
0
파일: memfun-err.C 프로젝트: ChenBoTang/gcc
 concept bool C() { return __is_class(T); }
예제 #2
0
파일: var-templ6.C 프로젝트: 0day-ci/gcc
// { dg-do compile { target c++14 } }

template<typename T>
  constexpr bool Class = __is_class(T);

template<typename T>
  constexpr bool Test = Class<T>;

struct S { };

static_assert(!Test<int>, "");
static_assert(Test<S>, "");
예제 #3
0
파일: traits.hpp 프로젝트: Luegg/origin
 concept bool 
 Class_type() { return __is_class(T); }
예제 #4
0
// { dg-options "-std=c++17 -fconcepts" }

template<typename T>
  concept bool C1 = __is_class(T);

template<typename T>
  concept bool C2() { return __is_class(T); }

template<typename T>
  constexpr bool C3 = __is_class(T);


template<typename U>
  requires C1<U>() // { dg-error "" }
  void f1(U) { }

template<typename U>
  requires C2<U> // { dg-error "invalid reference" }
  void f2(U) { }

template<C3 T>  // { dg-error "not a type" }
  void f(T) { } // { dg-error "" }