Yes, I have seen the workaround of putting commas on the next line, but this doesn't match some coding styles.
class dword_table
{
public:
dword_table(std::size_t count)
try
: m_array(new std::uint32_t[count]),
m_count(count),
{
}
catch (std::bad_alloc)
{
std::fprintf(stderr, "out of memory allocating %zu dwords", count);
throw;
}
...
};
Melissa
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
What's wrong with:my_class(int something): m_something(something), m_something_else(nullptr), m_init(false) {}I think it looks nice, reads well, cuts-and-pastes well, etc. Is there something here other than personal preference?
What's wrong with:my_class(int something): m_something(something), m_something_else(nullptr), m_init(false) {}I think it looks nice, reads well, cuts-and-pastes well, etc. Is there something here other than personal preference?
I like the way they line up. This is the only place I use this idiom. Apologies for the noise and the distasteful code!
The actual wording change seems to be trivial:I suppose a formal proposal is still required, though, since otherwise there'd be no way for committee members to register opposition?–Arthur
By the way, I apologize for the double post. Apparently, Google's posting form doesn't have bounce protection--the two "clicks" were from my thumb on my phone 1/8 second part.
Melissa
--
I think beginning with a comma is weird, like Thiago thinks, but you may not feel that it's weird. Use whichever, IMO.
The change to allow comma at the end of enum lists is a relatively recent one; C++11 I believe. That change had to go through the same process, the same resistance, etc., and yet it made it. Minor stuff does get accepted >.<
Melissa
And I repeat:It is a tool job to do its job properly, not language to adjust.
Surely you will not try to invent better form of plank in order to be able to hit nails more precisely?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To fix a minor annoyance for a long time, I think that the initializer list following a constructor prototype should allow a trailing comma with nothing after it. This also makes initializer lists consistent with enums (C++11) and aggregate initializers (C++03?). The purpose is to assist when editing, and helping when using "svn blame" or the equivalent for your version control.Yes, I have seen the workaround of putting commas on the next line, but this doesn't match some coding styles.
class dword_table
{
public:
dword_table(std::size_t count)
try
: m_array(new std::uint32_t[count]),
m_count(count),
{
}
catch (std::bad_alloc)
{
std::fprintf(stderr, "out of memory allocating %zu dwords", count);
throw;
}
...
};Melissa
I couldn't strongly argue your point, but to mention 2 things:
1) frequency of change (base-specifier list versus members initializer list)
2) usual layout:allowing a trailing comma is better suited for things that are usually vertically listed (such as enums and members initialization) rather than horizontally listed (base classes list, function arguments, template arguments). Let's keep in mind that VCS are line-oriented.
+1000. This inconsistency has always annoyed me as well.
--
struct Base1 { ... };
struct Base2
{
virtual ~Base2() { }
void DoStuff() { ... }
};
struct Derived : private Base1, Base2 { ... };
int main()
{
Base2 *meow = new Derived();
meow->DoStuff();
delete meow;
return 0;
}
On 2015–07–29, at 5:08 PM, Ville Voutilainen <ville.vo...@gmail.com> wrote:P.S. For people concerned about my "warding off work", feel free to
have a tasty stew
of crow.
Making the base class list behave this way would break existing code. For example:
struct Base1 { ... };
struct Base2
{
virtual ~Base2() { }
void DoStuff() { ... }
};
struct Derived : private Base1, Base2 { ... };
int main()
{
Base2 *meow = new Derived();
meow->DoStuff();
delete meow;
return 0;
}
I noticed the semicolon in Arthur's example; using that to distinguish the old way versus the new way resolves this problem, but making the semicolon have that sort of meaning feels crazy.
Anyone who ever said that must be nuts. You seem to be on a roll with GCC lately.If nobody else steps up, I’ll write the proposal. I’ll be sure to include some pictures of diffs.Base specifiers don’t seem to be part of this package.
--
---
You received this message because you are subscribed to a topic in the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.org/d/topic/std-proposals/I8N_75J9ZB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to std-proposal...@isocpp.org.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
On 2015–07–31, at 9:09 AM, Arthur O'Dwyer <arthur....@gmail.com> wrote:In practice the rule seems to be, "Wait for consensus to form in favor of trailing-comma in a specific construct, and then add just that one trailing-comma production to the grammar." But actually I can't think of any real reason for anyone to object to trailing-comma in all of the above cases.
Let's not start a flamewar right now, but just as a recreational puzzle, can anyone come up with a situation in which C++ currently uses comma as a separator (not the comma-operator) and where permitting "trailing comma" in that situation would lead to grammatical ambiguity?