Sunday, March 22, 2020

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

Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 22 11:12PM


> My heart of love goes out to each of you.
 
> May the Lord free you, then bind you up in His Kingdom, and keep secure you no matter what comes.
 
> Love. Joy. Peace. Hope. In Christ alone.
 
Fuck. Off.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
Melzzzzz <Melzzzzz@zzzzz.com>: Mar 22 09:46PM

> me. But no matter they write, or say, the only possible way they can offend
> me is that if they get my premission to do that, in advance.
 
> And I simply don't give anyone permission to offend me, that's all.
 
In other words, you don't get offended easilly ;)
 
--
press any key to continue or any other to quit...
U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec
Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec
Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi
bili naoruzani. -- Mladen Gogala
Sam <sam@email-scan.com>: Mar 22 07:06PM -0400

Melzzzzz writes:
 
> > me is that if they get my premission to do that, in advance.
 
> > And I simply don't give anyone permission to offend me, that's all.
 
> In other words, you don't get offended easilly ;)
 
Yes. And I have somewhat of a difficult time comprehending why anyone would
get offended at anything someone they don't even know would write on some
archaic, dying messaging system that few millenials are even aware of, these
days.
 
And the "dying messaging system" isn't really a key ingredient. Even if this
was Myspacebook, or Twatter; so someone writes something nasty, oh my. Calls
me a poopyhead, or something. Why is some random shlob's ranting would be
something I should care about? And be personally offended, no less? And even
going beyond that, why would someone need to make a grandiose spectacle of a
public announcement of one's righteous condemnation of such civil, uncouth
discourse, and then putting the source of it on some kind of a double-secret
probation, before one's delicate eyeballs will ever glaze over those
horrible, offensible, meany saying from that anonymous wretch, ever again?
 
I don't get it, and never will. I simply choose to avoid this trouble by
refusing to give anyone permission to offend me in the first place. Seems
like a much easier, simpler solution.
Maciej Sobczak <see.my.homepage@gmail.com>: Mar 22 03:14PM -0700

In the latest release of "Large Scale C++", Lakos describes a wrapping technique that involves passing pointers between objects of unrelated classes (say, class A and class B), where the pointer is of a third type (say, class T) that is only declared, but does not need to be ever defined. The pointer value is internally reinterpret_casted to whatever is needed, but this detail is not visible to the user of these classes.
So:
 
class T; // declared, but never defined
 
class A
{
public:
T * getT(); // reinterpret_cast<T *>(...)
};
 
class B
{
public:
void foo(T * p); // reinterpret_cast<something *>(p)
};
 
Without this idiom, the pointer would be passed around in the form of void*, but the use of class T adds some type safety, enables overloading, etc.
 
Lakos described this pattern as a way to hide inheritance between types that are supposed to be hidden behind a wrapper facade (like for example T being a "base class" for A, and B operating on that "base"), but my question is whether you have seen a wider use of this pattern.
 
The type safety is a defining added value of this pattern and it might have a wider applicability. Can you share your experiences?
 
--
Maciej Sobczak * http://www.inspirel.com
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 22 11:37PM +0100

On 22.03.2020 23:14, Maciej Sobczak wrote:
> for example T being a "base class" for A, and B operating on that
> "base"), but my question is whether you have seen a wider use of this
> pattern.
Not /exactly/ the same, but the handle types in the Win32 API match.
 
 
> The type safety is a defining added value of this pattern and it
> might have a wider applicability. Can you share your experiences?
 
A main problem in the Win32 API is when there are several conceptual
handle types that during their lifetimes, between creation and
destruction, act as the same kind, like a pointer to base class. In
particular HDC (handle to device context), if I recall correctly.
Depending on how it was created such handle must be destroyed by a
corresponding function, but the type does not encode that.
 
 
- Alf
Sam <sam@email-scan.com>: Mar 22 05:27PM -0400

alelvb writes:
 
> }
 
> and use it usually:
 
> Vector v = a ∧ b;
 
This look very similar to ^, which is perfectly overloadable:
 
class Foo{};
 
Foo operator^(const Foo &, const Foo &)
{
return Foo{};
}
 
And then write
 
Foo a = b ^ c;
 
For the dot and cross product you can overload + and *, and so on.
 
That's as much as you can do, within the existing boundaries of C++.
Paavo Helde <myfirstname@osa.pri.ee>: Mar 23 12:00AM +0200

On 22.03.2020 21:38, alelvb wrote:
> the symbols above.
> Wouldn't be nice writing something like:
 
> [return type] wildcard_operator(wchar_t op_symbol, Vector a, Vector, b)
 
Why not just operator⊗()?
 
And yes, maybe in 50 years, when Unicode has become universally adopted,
this thing could be standardized (the 25-30 years so far have shown
mixed results). Too bad all the code will be generated by AI bots by
that time...
Melzzzzz <Melzzzzz@zzzzz.com>: Mar 22 10:04PM

> mixed results). Too bad all the code will be generated by AI bots by
> that time...
 
Nope, on current computers, impossible. Unless someone figures out how brain works by then.
 
 
--
press any key to continue or any other to quit...
U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec
Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec
Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi
bili naoruzani. -- Mladen Gogala
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: