C++ Logo

std-discussion

Advanced search

QOL: trailing comma in template arguments

From: Jefferson Carpenter <jeffersoncarpenter2_at_[hidden]>
Date: Tue, 26 Jan 2021 08:02:11 +0000
Sometimes I like to format my code with std::variant alternatives placed
on individual lines for clarity and readability:

using LambdaTerm = std::variant<
   Abstraction,
   Variable,
   Application, // parse error
>;

But I can't put a trailing comma at the end of the variant, even though
that would make it easier to cut and paste alternatives for organization.


Any work-arounds, or immediate concerns making the trailing comma
allowed by c++ syntax?

thanks,
Jefferson

Received on 2021-01-26 02:02:19