C++ Logo

STD-DISCUSSION

Advanced search

Subject: QOL: trailing comma in template arguments
From: Jefferson Carpenter (jeffersoncarpenter2_at_[hidden])
Date: 2021-01-26 02:02:11


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


STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups