view gcc/testsuite/g++.dg/cpp2a/concepts-lambda6.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 2b5abeee2509
children
line wrap: on
line source

// PR c++/94645
// { dg-do compile { target concepts } }

struct unordered_map {
  int cend() const noexcept;
};

template <typename a> concept HasMapInterface = requires(a t) { t.cend(); };

template <typename Mapper> requires HasMapInterface<decltype(Mapper::map())>
struct l {
  friend void foo(l opt) { ([]() {})(); }
};

struct p {
  static unordered_map map();
};

void g(l<p> *y) { foo(*y); }