why is constexpr part of the line ? I thought it was just like inline. What's the real type of f in g ?
This works:
void f()
{
auto f = []() { return 42; };
auto p = f;
static_assert(std::is_same_v<decltype(f), decltype(p)>);
}
but this doesn't:
void g()
{
constexpr auto f = []() { return 42; };
auto p = f;
static_assert(std::is_same_v<decltype(f), decltype(p)>);
}
Aucun commentaire:
Enregistrer un commentaire