Monday, November 18, 2019

Digest for comp.lang.c++@googlegroups.com - 25 updates in 4 topics

"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 18 06:49PM +0100

As the title says, substitution failure can be an error:
 
 
#include <iostream>
#include <initializer_list>
#include <type_traits>
using namespace std;
 
template< class Value >
auto is_in( const initializer_list<Value>& list, const Value v )
-> bool
{ return false; }
 
//-----------------------------------
template< class Int >
struct S
{
using U = make_unsigned_t<Int>;
U m;
 
S( Int x, Int ): m( U( x ) ) {}
};
 
template< class Int >
auto is_in( const S<Int>& s, const Int v )
-> bool
{ return true; }
 
auto main()
-> int
{ return 100 + is_in( {&cout, &cerr}, &clog ); }
 
 
For now I've just used a `std::enable_if` to restrict `S` to integral
types, but I don't feel that this can be the best solution.
 
Like, it feels like a kludge, somewhat dirty.
 
 
- Alf
Ian Collins <ian-news@hotmail.com>: Nov 18 04:29PM +1300

On 18/11/2019 10:27, Sam wrote:
>> something. You're simply an idiot.
 
> And what exactly would be your professional qualifications for diagnosing
> someone to be an idiot?
 
A master's in trolling?
 
--
Ian.
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 07:01AM +0100

> to demonstrate your own professional qualifications for determining if
> someone's an idiot.
> So, let's see them (asking for a friend).
 
Ok, idiot wasn't correct; complete idiot would be more appropriate.
Sam <sam@email-scan.com>: Nov 18 10:16AM -0500

Bonita Montero writes:
 
>> someone's an idiot.
>> So, let's see them (asking for a friend).
 
> Ok, idiot wasn't correct; complete idiot would be more appropriate.
 
Oh, so you only have professional qualifications for evaluating if someone's
a complete idiot? That's good enough. Let's see them, please. Or, in the
alternate, what is your membership number in the American Society of
Standards in Working Idiocy Professional Evaluators; and I'll just look your
membership on their web site.
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 04:48PM +0100

> Or, in the alternate, what is your membership number in the American
> Society of Standards in Working Idiocy Professional Evaluators; and
> I'll just look your membership on their web site.
 
Everyone with an average knowledge of human nature has this, except you.
Sam <sam@email-scan.com>: Nov 18 11:33AM -0500

Bonita Montero writes:
 
>> Standards in Working Idiocy Professional Evaluators; and
>> I'll just look your membership on their web site.
 
> Everyone with an average knowledge of human nature has this, except you.
 
Do you consider yourself as having "average knowledge"? If so, then you must
be a member of a professional organization, according to your own words.
 
I never claimed to be a professional member of any such organization in this
thread. You demanded that I must be one, in order to diagnose your case of
projection, and I did not dispute that I never claimed to be one.
 
I still don't quite understand your reluctance to show your proof of
membership in the American Society of Standards in Working Idiocy
Professional Evaluators. Are you or are you not a member? By your own rules,
you must be one, in order to call someone either an idiot, or a complete
idiot (still not sure about that one).
 
Or, maybe you just expect me to take your word for it?
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 05:41PM +0100

> I never claimed to be a professional member of any such organization in
> this thread. You demanded that I must be one, in order to diagnose your
> case of projection, and I did not dispute that I never claimed to be one.
 
In Germany we call diagnoses like yours as "kitchen psychology" which
could be translated ad layman's psychology. And those diagnoses are
not even inprecise, but usually nonsense.
You're simply a stupid person.
Sam <sam@email-scan.com>: Nov 18 11:58AM -0500

Bonita Montero writes:
 
>> I never claimed to be a professional member of any such organization in
>> this thread. You demanded that I must be one, in order to diagnose your
>> case of projection, and I did not dispute that I never claimed to be one.
 
[ important context restored ]
 
> could be translated ad layman's psychology. And those diagnoses are
> not even inprecise, but usually nonsense.
> You're simply a stupid person.
 
It does seem, for whatever reason, you're trying to deny your A.S.S.W.I.P.E.
membership. Why would you do this? You should be proud for being a card-
carrying A.S.S.W.I.P.E. It's a major accomplishment, that few achieve in
their lifetime.
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 06:15PM +0100

> A.S.S.W.I.P.E. membership. Why would you do this? You should be proud
> for being a card-carrying A.S.S.W.I.P.E. It's a major accomplishment,
> that few achieve in their lifetime.
 
Youre a stupid, immature troll.
Sam <sam@email-scan.com>: Nov 18 12:22PM -0500

Bonita Montero writes:
 
>> carrying A.S.S.W.I.P.E. It's a major accomplishment, that few achieve in
>> their lifetime.
 
> Youre a stupid, immature troll.
 
Would someone need professional credentials, to make that kind of diagnosis?
James Kuyper <jameskuyper@alumni.caltech.edu>: Nov 17 06:39PM -0500

On 11/16/19 9:40 PM, Chris M. Thomasson wrote:
> On 11/16/2019 2:13 PM, Scott Lurndal wrote:
...
>> ... running slow is expected, crashing ... isn't).
...
> It should not crash, slowing to a crawl is expected.
 
You just said the same thing, with slightly different wording. Your point?
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 17 08:59PM -0800

On 11/17/2019 3:39 PM, James Kuyper wrote:
> ...
>> It should not crash, slowing to a crawl is expected.
 
> You just said the same thing, with slightly different wording. Your point?
 
My point is that hammering a single mutex should not crash the system.
It will most likely slow it to a crawl. Not start crashing processes
left and right...
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 17 09:00PM -0800

On 11/17/2019 8:59 PM, Chris M. Thomasson wrote:
 
> My point is that hammering a single mutex should not crash the system.
> It will most likely slow it to a crawl. Not start crashing processes
> left and right...
 
Well, the processes will be working, just going really, really slow. I
hope its not like a slug hiking up a mountain of salt.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 17 09:01PM -0800

On 11/17/2019 6:58 AM, Bonita Montero wrote:
>> itself to decide.
 
> Wrong. If you pack your members tighter than alignof(membertype) allows
> this is not conforming.
 
Wrt the work I did wrt straddling cache lines, well, it was all in
assembly language. Pre C++11.
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 07:00AM +0100


> Wrt the work I did wrt straddling cache lines, well, it was all in
> assembly language. Pre C++11.
 
>ou have the gift of contributing continuously to things that
have nothing to do with the topic.
"Öö Tiib" <ootiib@hot.ee>: Nov 17 10:45PM -0800

On Sunday, 17 November 2019 16:59:03 UTC+2, Bonita Montero wrote:
> > itself to decide.
 
> Wrong. If you pack your members tighter than alignof(membertype) allows
> this is not conforming.
 
That is a bald and groundless assertion.
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 07:52AM +0100


>> Wrong. If you pack your members tighter than alignof(membertype)
>> allows this is not conforming.
 
> That is a bald and groundless assertion.
 
"Object types have alignment requirements (6.9.1, 6.9.2) which place
restrictions on the addresses at which an object of that type may be
allocated. ...
The result of the alignof operator reflects the alignment requirement
of the type in the complete-object case."
 
So if you pack your data tighter than the alignment-requirements
allow, this is not conforming.
"Öö Tiib" <ootiib@hot.ee>: Nov 17 10:54PM -0800

On Sunday, 17 November 2019 16:49:59 UTC+2, Bonita Montero wrote:
 
> The standard says that all objects of complete types have a poper
> alignment.
 
That is bald, groundless and nonsensical assertion.
All objects *must* have complete types in C++ program:
"A program is ill-formed if the definition of any object gives
the object an incomplete type."
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 08:03AM +0100

do you want to do pettifoggery while having lost in the actual
discussion?
"Öö Tiib" <ootiib@hot.ee>: Nov 17 11:05PM -0800

On Monday, 18 November 2019 08:52:27 UTC+2, Bonita Montero wrote:
 
> "Object types have alignment requirements (6.9.1, 6.9.2) which place
> restrictions on the addresses at which an object of that type may be
> allocated. ...
 
...
The alignment required for a type might be different when it is used
as the type of a complete object and when it is used as the type of
a subobject.
...
 
> of the type in the complete-object case."
 
> So if you pack your data tighter than the alignment-requirements
> allow, this is not conforming.
 
Members are subobjects not complete objects.
"Objects can contain other objects, called /subobjects/. A subobject
can be a member subobject, a baseclass subobject, or an array element."
Bonita Montero <Bonita.Montero@gmail.com>: Nov 18 08:10AM +0100

> as the type of a complete object and when it is used as the type of
> a subobject.
> ...
 
Since you can't get the alignment-requiremen of both with the alignof
-operator I didn't say any different.
 
 
>> So if you pack your data tighter than the alignment-requirements
>> allow, this is not conforming.
 
> Members are subobjects not complete objects.
 
That's pettifogging.
"Öö Tiib" <ootiib@hot.ee>: Nov 17 11:23PM -0800

On Monday, 18 November 2019 09:10:46 UTC+2, Bonita Montero wrote:
> > ...
 
> Since you can't get the alignment-requiremen of both with the alignof
> -operator I didn't say any different.
 
No, you can't you quoted and now erased it back. Restoring:
 
On Monday, 18 November 2019 08:52:27 UTC+2, Bonita Montero wrote:
> >> The result of the alignof operator reflects the alignment requirement
> >> of the type in the complete-object case.
 
I have written it whole week.
 
 
> >> allow, this is not conforming.
 
> > Members are subobjects not complete objects.
 
> That's pettifogging.
 
You think that you can change what standard says by erasing attributions
and context in Usenet post? :D
Ian Collins <ian-news@hotmail.com>: Nov 18 08:26PM +1300

On 18/11/2019 20:23, Öö Tiib wrote:
 
 
> You think that you can change what standard says by erasing attributions
> and context in Usenet post? :D
 
What else did you expect?
 
--
Ian.
James Kuyper <jameskuyper@alumni.caltech.edu>: Nov 18 08:25AM -0500

On 11/17/19 11:59 PM, Chris M. Thomasson wrote:
>>> It should not crash, slowing to a crawl is expected.
 
>> You just said the same thing, with slightly different wording. Your point?
 
> My point is that hammering a single mutex should not crash the system.
 
But, Scott already said that a crashing was not expected, so why the "me
too" post?
Richard Damon <Richard@Damon-Family.org>: Nov 18 07:40AM -0500

On 11/10/19 9:31 AM, Paavo Helde wrote:
 
> A. But, but, with signed integers, there are different representations,
> so that on some hardware it does not actually wrap!
 
> B. Ouch, my head is hurting. Just declare it undefined then!
 
My guess at that converstation is it would go like:
 
A: BTW, what should we do with the arithmetic overflow? There are
overflow flags and extended precision results in some hardware that we
could use.
 
B: How does that work on the other machines, can we do this efficiently?
 
C: Not on my machine, we do it differently than that, we do it by xxx.
 
A: My machine can't do it that way!
 
B: Sounds like we can't make it part of the standard, leave it for
implementation extensions.
 
A: But in case of multiplication, we might lose half of the result!
 
D: My machine doesn't automatically create a double precision result,
that would slow me down a lot.
 
B: Sounds like an extension too.
 
 
Note, the key in this discussion was focused on defining consistent
behavior in the language where the target machines had behavior that
could be made easily consistent, and leaving as undefined behavior (or
unspecified/implementation defined) that wasn't. These decisions were
initially being made in the 70's and 80's, and at that time there were a
lot more machines with unique operating modes.
 
Note also, it was EXPECTED that implementations would implement
extensions to let a program access special features of the machine to be
more efficient on that machine. Special symbols/keywords to get access
to things like the carry bit, or double precision multiplication. I
remember using a multiply-divide intrinsic that would compute
 
a * b / c where the product was done to double precision (long) and the
divide took that to yield a int result.
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: