- Doesn't "explicit" mean explicit? - 3 Updates
- How to make a template class-friend function - 2 Updates
- embedded assignment - 1 Update
DSF <notavalid@address.here>: Jan 18 01:36PM -0500 On Thu, 15 Jan 2015 21:48:10 +0100, Marcel Mueller >explicit prevents from implicit constructor invocation without using the >constructors name (= class name), e.g. for copy construction. >Marcel Thanks for the explanation, DSF "'Later' is the beginning of what's not to be." D.S. Fiscus |
DSF <notavalid@address.here>: Jan 18 01:38PM -0500 On Thu, 15 Jan 2015 13:53:51 -0800, red floyd <no.spam@its.invalid> wrote: >FBaseString x(77); // OK >FBaseString y = FBaseString(77); // also OK >FBaseString z = 77; // ERROR -- constructor is explicit Thanks for expanding on Marcel's explanation, DSF "'Later' is the beginning of what's not to be." D.S. Fiscus |
DSF <notavalid@address.here>: Jan 18 01:39PM -0500 On Thu, 15 Jan 2015 17:50:14 -0500, Victor Bazarov >'size_t'. I mean, on the close examination of the error message's >penultimate line... >V "Head of nail, meet hammer." was what I wanted to type because I found a typedef for wchar_t. But it turns out that it's only used if __cplusplus is not defined, making wchar_t available for C code. (I've done much the same thing for bool, true, and false.) wchar_t *is* a native type. DSF "'Later' is the beginning of what's not to be." D.S. Fiscus |
red floyd <no.spam.here@its.invalid>: Jan 17 07:11PM -0800 On 1/17/2015 9:48 AM, JiiPee wrote: > is one of these where I though the error was there but it was somewhere > else (it has to do with the base class *-operation function ... they > somehow conflict.... i ll check this later). I'm glad you found the error, but if you hadn't... My point was that 5.8 tells you how to post problems. 1. Post the code 2. Name the compiler and system 3. Post your errors. |
JiiPee <no@notvalid.com>: Jan 18 12:23PM On 18/01/2015 03:11, red floyd wrote: > 1. Post the code > 2. Name the compiler and system > 3. Post your errors. yes true. although if its a very simple issue, like one line, i guess its not necessary all those. But here yes... am still trying to figure out what causes it. |
ram@zedat.fu-berlin.de (Stefan Ram): Jan 17 11:52PM >I agree. It is good policy that your code-base produces no warnings. I use -Wall and -Wextra, but then I disable some warnings that I do not agree with. What consitutes a warning depends on the compiler and the compiler options chosen and is to some extend arbitrary. I would not like to have arbitrary decisions rule my code. Therefore, when I am sure that I like the code the way it is, I would not change it just to silence a warning. So I would feel unlucky, when I would be forced to do this by -Werr. However, I prefer code to produce no warnings (as you write above), because you can't easily see whether a warning was already accepted by you to be ignored or is a new warning that has not been investigated yet (in fewer words: old warnings might hide new warnings). Therefore, I prefer to have no warnings, even without them being classified as errors. When I do not agree with the author of the warning, I use -Wno-..., otherwise I change my code. An exceptionđ might be maintaining an old code-base that generates thousands of warnings (while the application generated might actually be working without obvious problems). One cannot investigate all these warnings in the near future. In this case, getting rid of all warnings is more a long-term goal. For the time being, one might try to investigate the most alarming warnings only. When you use -Wall -Wextra -Werr on such a project and have a fixed date when it must compile, there even is a risk that the code that generates those warning errors is modified in a hurry and this introduces new semantic errors (that will not be flagged by the compiler) into the code. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment